using System;
using System.Diagnostics;

namespace NBitcoin.Altcoins.HashX11.Crypto.SHA3
{
    internal abstract class FugueBase : BlockHash, ICryptoNotBuildIn
    {
        protected int m_base;
        protected readonly uint[] m_state = new uint[36];

        public FugueBase(HashSize a_hash_size, int a_block_size)
            : base((int)a_hash_size, a_block_size, 4)
        {
            Initialize();
        }

        protected override void Finish()
        {
            ulong bits = m_processed_bytes * 8;

            int padindex = 4 - (int)(m_processed_bytes % 4);

            if (padindex == 4)
                padindex = 0;

            byte[] pad = new byte[padindex + 8];

            Converters.ConvertULongToBytesSwapOrder(bits, pad, padindex);
            padindex += 8;

            TransformBytes(pad, 0, padindex);
        }

        public override void Initialize()
        {
            m_base = 0;
            Array.Clear(m_state, 0, BlockSize - HashSize / 4);

            base.Initialize();
        }

        public override void TransformBytes(byte[] a_data, int a_index, int a_length)
        {
            Debug.Assert(a_index >= 0);
            Debug.Assert(a_length >= 0);
            Debug.Assert(a_index + a_length <= a_data.Length);

            if (!m_buffer.IsEmpty)
            {
                m_buffer.Feed(a_data, ref a_index, ref a_length, ref m_processed_bytes);

                if (m_buffer.IsFull)
                    TransformBlocks(m_buffer.GetBytes(), 0, 4);
            }

            if (a_length >= 4)
            {
                int bytes = (a_length / 4) * 4;
                m_processed_bytes += (ulong)bytes;
                TransformBlocks(a_data, a_index, bytes);
                a_index += bytes;
                a_length -= bytes;
            }

            if (a_length > 0)
            {
                m_buffer.Feed(a_data, ref a_index, ref a_length, ref m_processed_bytes);
            }
        }

        public override HashResult ComputeBytes(byte[] a_data)
        {
            Initialize();
            TransformBytes(a_data, 0, a_data.Length);
            return TransformFinal();
        }

        protected override void TransformBlock(byte[] a_data, int a_index)
        {
            throw new NotImplementedException();
        }

        protected abstract void TransformBlocks(byte[] a_data, int a_index, int a_length);
    };

    internal abstract class Fugue256Base : FugueBase
    {
        #region Consts
        protected readonly static ulong[] s_aes_style_table0 = 
        {
            0x6363973297326363, 0x7C7CEB6FEB6F7C7C, 0x7777C75EC75E7777, 0x7B7BF77AF77A7B7B, 
            0xF2F2E5E8E5E8F2F2, 0x6B6BB70AB70A6B6B, 0x6F6FA716A7166F6F, 0xC5C5396D396DC5C5, 
            0x3030C090C0903030, 0x0101040704070101, 0x6767872E872E6767, 0x2B2BACD1ACD12B2B, 
            0xFEFED5CCD5CCFEFE, 0xD7D771137113D7D7, 0xABAB9A7C9A7CABAB, 0x7676C359C3597676, 
            0xCACA05400540CACA, 0x82823EA33EA38282, 0xC9C909490949C9C9, 0x7D7DEF68EF687D7D, 
            0xFAFAC5D0C5D0FAFA, 0x59597F947F945959, 0x474707CE07CE4747, 0xF0F0EDE6EDE6F0F0, 
            0xADAD826E826EADAD, 0xD4D47D1A7D1AD4D4, 0xA2A2BE43BE43A2A2, 0xAFAF8A608A60AFAF, 
            0x9C9C46F946F99C9C, 0xA4A4A651A651A4A4, 0x7272D345D3457272, 0xC0C02D762D76C0C0, 
            0xB7B7EA28EA28B7B7, 0xFDFDD9C5D9C5FDFD, 0x93937AD47AD49393, 0x262698F298F22626, 
            0x3636D882D8823636, 0x3F3FFCBDFCBD3F3F, 0xF7F7F1F3F1F3F7F7, 0xCCCC1D521D52CCCC, 
            0x3434D08CD08C3434, 0xA5A5A256A256A5A5, 0xE5E5B98DB98DE5E5, 0xF1F1E9E1E9E1F1F1, 
            0x7171DF4CDF4C7171, 0xD8D84D3E4D3ED8D8, 0x3131C497C4973131, 0x1515546B546B1515, 
            0x0404101C101C0404, 0xC7C731633163C7C7, 0x23238CE98CE92323, 0xC3C3217F217FC3C3, 
            0x1818604860481818, 0x96966ECF6ECF9696, 0x0505141B141B0505, 0x9A9A5EEB5EEB9A9A, 
            0x07071C151C150707, 0x1212487E487E1212, 0x808036AD36AD8080, 0xE2E2A598A598E2E2, 
            0xEBEB81A781A7EBEB, 0x27279CF59CF52727, 0xB2B2FE33FE33B2B2, 0x7575CF50CF507575, 
            0x0909243F243F0909, 0x83833AA43AA48383, 0x2C2CB0C4B0C42C2C, 0x1A1A684668461A1A, 
            0x1B1B6C416C411B1B, 0x6E6EA311A3116E6E, 0x5A5A739D739D5A5A, 0xA0A0B64DB64DA0A0, 
            0x525253A553A55252, 0x3B3BECA1ECA13B3B, 0xD6D675147514D6D6, 0xB3B3FA34FA34B3B3, 
            0x2929A4DFA4DF2929, 0xE3E3A19FA19FE3E3, 0x2F2FBCCDBCCD2F2F, 0x848426B126B18484, 
            0x535357A257A25353, 0xD1D169016901D1D1, 0x0000000000000000, 0xEDED99B599B5EDED, 
            0x202080E080E02020, 0xFCFCDDC2DDC2FCFC, 0xB1B1F23AF23AB1B1, 0x5B5B779A779A5B5B, 
            0x6A6AB30DB30D6A6A, 0xCBCB01470147CBCB, 0xBEBECE17CE17BEBE, 0x3939E4AFE4AF3939, 
            0x4A4A33ED33ED4A4A, 0x4C4C2BFF2BFF4C4C, 0x58587B937B935858, 0xCFCF115B115BCFCF, 
            0xD0D06D066D06D0D0, 0xEFEF91BB91BBEFEF, 0xAAAA9E7B9E7BAAAA, 0xFBFBC1D7C1D7FBFB, 
            0x434317D217D24343, 0x4D4D2FF82FF84D4D, 0x3333CC99CC993333, 0x858522B622B68585, 
            0x45450FC00FC04545, 0xF9F9C9D9C9D9F9F9, 0x0202080E080E0202, 0x7F7FE766E7667F7F, 
            0x50505BAB5BAB5050, 0x3C3CF0B4F0B43C3C, 0x9F9F4AF04AF09F9F, 0xA8A896759675A8A8, 
            0x51515FAC5FAC5151, 0xA3A3BA44BA44A3A3, 0x40401BDB1BDB4040, 0x8F8F0A800A808F8F, 
            0x92927ED37ED39292, 0x9D9D42FE42FE9D9D, 0x3838E0A8E0A83838, 0xF5F5F9FDF9FDF5F5, 
            0xBCBCC619C619BCBC, 0xB6B6EE2FEE2FB6B6, 0xDADA45304530DADA, 0x212184E784E72121, 
            0x1010407040701010, 0xFFFFD1CBD1CBFFFF, 0xF3F3E1EFE1EFF3F3, 0xD2D265086508D2D2, 
            0xCDCD19551955CDCD, 0x0C0C302430240C0C, 0x13134C794C791313, 0xECEC9DB29DB2ECEC, 
            0x5F5F678667865F5F, 0x97976AC86AC89797, 0x44440BC70BC74444, 0x17175C655C651717, 
            0xC4C43D6A3D6AC4C4, 0xA7A7AA58AA58A7A7, 0x7E7EE361E3617E7E, 0x3D3DF4B3F4B33D3D, 
            0x64648B278B276464, 0x5D5D6F886F885D5D, 0x1919644F644F1919, 0x7373D742D7427373, 
            0x60609B3B9B3B6060, 0x818132AA32AA8181, 0x4F4F27F627F64F4F, 0xDCDC5D225D22DCDC, 
            0x222288EE88EE2222, 0x2A2AA8D6A8D62A2A, 0x909076DD76DD9090, 0x8888169516958888, 
            0x464603C903C94646, 0xEEEE95BC95BCEEEE, 0xB8B8D605D605B8B8, 0x1414506C506C1414, 
            0xDEDE552C552CDEDE, 0x5E5E638163815E5E, 0x0B0B2C312C310B0B, 0xDBDB41374137DBDB, 
            0xE0E0AD96AD96E0E0, 0x3232C89EC89E3232, 0x3A3AE8A6E8A63A3A, 0x0A0A283628360A0A, 
            0x49493FE43FE44949, 0x0606181218120606, 0x242490FC90FC2424, 0x5C5C6B8F6B8F5C5C, 
            0xC2C225782578C2C2, 0xD3D3610F610FD3D3, 0xACAC86698669ACAC, 0x6262933593356262, 
            0x919172DA72DA9191, 0x959562C662C69595, 0xE4E4BD8ABD8AE4E4, 0x7979FF74FF747979, 
            0xE7E7B183B183E7E7, 0xC8C80D4E0D4EC8C8, 0x3737DC85DC853737, 0x6D6DAF18AF186D6D, 
            0x8D8D028E028E8D8D, 0xD5D5791D791DD5D5, 0x4E4E23F123F14E4E, 0xA9A992729272A9A9, 
            0x6C6CAB1FAB1F6C6C, 0x565643B943B95656, 0xF4F4FDFAFDFAF4F4, 0xEAEA85A085A0EAEA, 
            0x65658F208F206565, 0x7A7AF37DF37D7A7A, 0xAEAE8E678E67AEAE, 0x0808203820380808, 
            0xBABADE0BDE0BBABA, 0x7878FB73FB737878, 0x252594FB94FB2525, 0x2E2EB8CAB8CA2E2E, 
            0x1C1C705470541C1C, 0xA6A6AE5FAE5FA6A6, 0xB4B4E621E621B4B4, 0xC6C635643564C6C6, 
            0xE8E88DAE8DAEE8E8, 0xDDDD59255925DDDD, 0x7474CB57CB577474, 0x1F1F7C5D7C5D1F1F, 
            0x4B4B37EA37EA4B4B, 0xBDBDC21EC21EBDBD, 0x8B8B1A9C1A9C8B8B, 0x8A8A1E9B1E9B8A8A, 
            0x7070DB4BDB4B7070, 0x3E3EF8BAF8BA3E3E, 0xB5B5E226E226B5B5, 0x6666832983296666, 
            0x48483BE33BE34848, 0x03030C090C090303, 0xF6F6F5F4F5F4F6F6, 0x0E0E382A382A0E0E, 
            0x61619F3C9F3C6161, 0x3535D48BD48B3535, 0x575747BE47BE5757, 0xB9B9D202D202B9B9, 
            0x86862EBF2EBF8686, 0xC1C129712971C1C1, 0x1D1D745374531D1D, 0x9E9E4EF74EF79E9E, 
            0xE1E1A991A991E1E1, 0xF8F8CDDECDDEF8F8, 0x989856E556E59898, 0x1111447744771111, 
            0x6969BF04BF046969, 0xD9D949394939D9D9, 0x8E8E0E870E878E8E, 0x949466C166C19494, 
            0x9B9B5AEC5AEC9B9B, 0x1E1E785A785A1E1E, 0x87872AB82AB88787, 0xE9E989A989A9E9E9, 
            0xCECE155C155CCECE, 0x55554FB04FB05555, 0x2828A0D8A0D82828, 0xDFDF512B512BDFDF, 
            0x8C8C068906898C8C, 0xA1A1B24AB24AA1A1, 0x8989129212928989, 0x0D0D342334230D0D, 
            0xBFBFCA10CA10BFBF, 0xE6E6B584B584E6E6, 0x424213D513D54242, 0x6868BB03BB036868, 
            0x41411FDC1FDC4141, 0x999952E252E29999, 0x2D2DB4C3B4C32D2D, 0x0F0F3C2D3C2D0F0F, 
            0xB0B0F63DF63DB0B0, 0x54544BB74BB75454, 0xBBBBDA0CDA0CBBBB, 0x1616586258621616
        };

        protected readonly static ulong[] s_aes_style_table1 = 
        {
            0x6397326332636397, 0x7CEB6F7C6F7C7CEB, 0x77C75E775E7777C7, 0x7BF77A7B7A7B7BF7, 
            0xF2E5E8F2E8F2F2E5, 0x6BB70A6B0A6B6BB7, 0x6FA7166F166F6FA7, 0xC5396DC56DC5C539, 
            0x30C09030903030C0, 0x0104070107010104, 0x67872E672E676787, 0x2BACD12BD12B2BAC, 
            0xFED5CCFECCFEFED5, 0xD77113D713D7D771, 0xAB9A7CAB7CABAB9A, 0x76C35976597676C3, 
            0xCA0540CA40CACA05, 0x823EA382A382823E, 0xC90949C949C9C909, 0x7DEF687D687D7DEF, 
            0xFAC5D0FAD0FAFAC5, 0x597F94599459597F, 0x4707CE47CE474707, 0xF0EDE6F0E6F0F0ED, 
            0xAD826EAD6EADAD82, 0xD47D1AD41AD4D47D, 0xA2BE43A243A2A2BE, 0xAF8A60AF60AFAF8A, 
            0x9C46F99CF99C9C46, 0xA4A651A451A4A4A6, 0x72D34572457272D3, 0xC02D76C076C0C02D, 
            0xB7EA28B728B7B7EA, 0xFDD9C5FDC5FDFDD9, 0x937AD493D493937A, 0x2698F226F2262698, 
            0x36D88236823636D8, 0x3FFCBD3FBD3F3FFC, 0xF7F1F3F7F3F7F7F1, 0xCC1D52CC52CCCC1D, 
            0x34D08C348C3434D0, 0xA5A256A556A5A5A2, 0xE5B98DE58DE5E5B9, 0xF1E9E1F1E1F1F1E9, 
            0x71DF4C714C7171DF, 0xD84D3ED83ED8D84D, 0x31C49731973131C4, 0x15546B156B151554, 
            0x04101C041C040410, 0xC73163C763C7C731, 0x238CE923E923238C, 0xC3217FC37FC3C321, 
            0x1860481848181860, 0x966ECF96CF96966E, 0x05141B051B050514, 0x9A5EEB9AEB9A9A5E, 
            0x071C15071507071C, 0x12487E127E121248, 0x8036AD80AD808036, 0xE2A598E298E2E2A5, 
            0xEB81A7EBA7EBEB81, 0x279CF527F527279C, 0xB2FE33B233B2B2FE, 0x75CF5075507575CF, 
            0x09243F093F090924, 0x833AA483A483833A, 0x2CB0C42CC42C2CB0, 0x1A68461A461A1A68, 
            0x1B6C411B411B1B6C, 0x6EA3116E116E6EA3, 0x5A739D5A9D5A5A73, 0xA0B64DA04DA0A0B6, 
            0x5253A552A5525253, 0x3BECA13BA13B3BEC, 0xD67514D614D6D675, 0xB3FA34B334B3B3FA, 
            0x29A4DF29DF2929A4, 0xE3A19FE39FE3E3A1, 0x2FBCCD2FCD2F2FBC, 0x8426B184B1848426, 
            0x5357A253A2535357, 0xD16901D101D1D169, 0x0000000000000000, 0xED99B5EDB5EDED99, 
            0x2080E020E0202080, 0xFCDDC2FCC2FCFCDD, 0xB1F23AB13AB1B1F2, 0x5B779A5B9A5B5B77, 
            0x6AB30D6A0D6A6AB3, 0xCB0147CB47CBCB01, 0xBECE17BE17BEBECE, 0x39E4AF39AF3939E4, 
            0x4A33ED4AED4A4A33, 0x4C2BFF4CFF4C4C2B, 0x587B93589358587B, 0xCF115BCF5BCFCF11, 
            0xD06D06D006D0D06D, 0xEF91BBEFBBEFEF91, 0xAA9E7BAA7BAAAA9E, 0xFBC1D7FBD7FBFBC1, 
            0x4317D243D2434317, 0x4D2FF84DF84D4D2F, 0x33CC9933993333CC, 0x8522B685B6858522, 
            0x450FC045C045450F, 0xF9C9D9F9D9F9F9C9, 0x02080E020E020208, 0x7FE7667F667F7FE7, 
            0x505BAB50AB50505B, 0x3CF0B43CB43C3CF0, 0x9F4AF09FF09F9F4A, 0xA89675A875A8A896, 
            0x515FAC51AC51515F, 0xA3BA44A344A3A3BA, 0x401BDB40DB40401B, 0x8F0A808F808F8F0A, 
            0x927ED392D392927E, 0x9D42FE9DFE9D9D42, 0x38E0A838A83838E0, 0xF5F9FDF5FDF5F5F9, 
            0xBCC619BC19BCBCC6, 0xB6EE2FB62FB6B6EE, 0xDA4530DA30DADA45, 0x2184E721E7212184, 
            0x1040701070101040, 0xFFD1CBFFCBFFFFD1, 0xF3E1EFF3EFF3F3E1, 0xD26508D208D2D265, 
            0xCD1955CD55CDCD19, 0x0C30240C240C0C30, 0x134C79137913134C, 0xEC9DB2ECB2ECEC9D, 
            0x5F67865F865F5F67, 0x976AC897C897976A, 0x440BC744C744440B, 0x175C65176517175C, 
            0xC43D6AC46AC4C43D, 0xA7AA58A758A7A7AA, 0x7EE3617E617E7EE3, 0x3DF4B33DB33D3DF4, 
            0x648B27642764648B, 0x5D6F885D885D5D6F, 0x19644F194F191964, 0x73D74273427373D7, 
            0x609B3B603B60609B, 0x8132AA81AA818132, 0x4F27F64FF64F4F27, 0xDC5D22DC22DCDC5D, 
            0x2288EE22EE222288, 0x2AA8D62AD62A2AA8, 0x9076DD90DD909076, 0x8816958895888816, 
            0x4603C946C9464603, 0xEE95BCEEBCEEEE95, 0xB8D605B805B8B8D6, 0x14506C146C141450, 
            0xDE552CDE2CDEDE55, 0x5E63815E815E5E63, 0x0B2C310B310B0B2C, 0xDB4137DB37DBDB41, 
            0xE0AD96E096E0E0AD, 0x32C89E329E3232C8, 0x3AE8A63AA63A3AE8, 0x0A28360A360A0A28, 
            0x493FE449E449493F, 0x0618120612060618, 0x2490FC24FC242490, 0x5C6B8F5C8F5C5C6B, 
            0xC22578C278C2C225, 0xD3610FD30FD3D361, 0xAC8669AC69ACAC86, 0x6293356235626293, 
            0x9172DA91DA919172, 0x9562C695C6959562, 0xE4BD8AE48AE4E4BD, 0x79FF7479747979FF, 
            0xE7B183E783E7E7B1, 0xC80D4EC84EC8C80D, 0x37DC8537853737DC, 0x6DAF186D186D6DAF, 
            0x8D028E8D8E8D8D02, 0xD5791DD51DD5D579, 0x4E23F14EF14E4E23, 0xA99272A972A9A992, 
            0x6CAB1F6C1F6C6CAB, 0x5643B956B9565643, 0xF4FDFAF4FAF4F4FD, 0xEA85A0EAA0EAEA85, 
            0x658F20652065658F, 0x7AF37D7A7D7A7AF3, 0xAE8E67AE67AEAE8E, 0x0820380838080820, 
            0xBADE0BBA0BBABADE, 0x78FB7378737878FB, 0x2594FB25FB252594, 0x2EB8CA2ECA2E2EB8, 
            0x1C70541C541C1C70, 0xA6AE5FA65FA6A6AE, 0xB4E621B421B4B4E6, 0xC63564C664C6C635, 
            0xE88DAEE8AEE8E88D, 0xDD5925DD25DDDD59, 0x74CB5774577474CB, 0x1F7C5D1F5D1F1F7C, 
            0x4B37EA4BEA4B4B37, 0xBDC21EBD1EBDBDC2, 0x8B1A9C8B9C8B8B1A, 0x8A1E9B8A9B8A8A1E, 
            0x70DB4B704B7070DB, 0x3EF8BA3EBA3E3EF8, 0xB5E226B526B5B5E2, 0x6683296629666683, 
            0x483BE348E348483B, 0x030C09030903030C, 0xF6F5F4F6F4F6F6F5, 0x0E382A0E2A0E0E38, 
            0x619F3C613C61619F, 0x35D48B358B3535D4, 0x5747BE57BE575747, 0xB9D202B902B9B9D2, 
            0x862EBF86BF86862E, 0xC12971C171C1C129, 0x1D74531D531D1D74, 0x9E4EF79EF79E9E4E, 
            0xE1A991E191E1E1A9, 0xF8CDDEF8DEF8F8CD, 0x9856E598E5989856, 0x1144771177111144, 
            0x69BF0469046969BF, 0xD94939D939D9D949, 0x8E0E878E878E8E0E, 0x9466C194C1949466, 
            0x9B5AEC9BEC9B9B5A, 0x1E785A1E5A1E1E78, 0x872AB887B887872A, 0xE989A9E9A9E9E989, 
            0xCE155CCE5CCECE15, 0x554FB055B055554F, 0x28A0D828D82828A0, 0xDF512BDF2BDFDF51, 
            0x8C06898C898C8C06, 0xA1B24AA14AA1A1B2, 0x8912928992898912, 0x0D34230D230D0D34, 
            0xBFCA10BF10BFBFCA, 0xE6B584E684E6E6B5, 0x4213D542D5424213, 0x68BB0368036868BB, 
            0x411FDC41DC41411F, 0x9952E299E2999952, 0x2DB4C32DC32D2DB4, 0x0F3C2D0F2D0F0F3C, 
            0xB0F63DB03DB0B0F6, 0x544BB754B754544B, 0xBBDA0CBB0CBBBBDA, 0x1658621662161658
        };

        protected readonly static ulong[] s_aes_style_table2 = 
        {
            0x9732636363639732, 0xEB6F7C7C7C7CEB6F, 0xC75E77777777C75E, 0xF77A7B7B7B7BF77A, 
            0xE5E8F2F2F2F2E5E8, 0xB70A6B6B6B6BB70A, 0xA7166F6F6F6FA716, 0x396DC5C5C5C5396D, 
            0xC09030303030C090, 0x0407010101010407, 0x872E67676767872E, 0xACD12B2B2B2BACD1, 
            0xD5CCFEFEFEFED5CC, 0x7113D7D7D7D77113, 0x9A7CABABABAB9A7C, 0xC35976767676C359, 
            0x0540CACACACA0540, 0x3EA3828282823EA3, 0x0949C9C9C9C90949, 0xEF687D7D7D7DEF68, 
            0xC5D0FAFAFAFAC5D0, 0x7F94595959597F94, 0x07CE4747474707CE, 0xEDE6F0F0F0F0EDE6, 
            0x826EADADADAD826E, 0x7D1AD4D4D4D47D1A, 0xBE43A2A2A2A2BE43, 0x8A60AFAFAFAF8A60, 
            0x46F99C9C9C9C46F9, 0xA651A4A4A4A4A651, 0xD34572727272D345, 0x2D76C0C0C0C02D76, 
            0xEA28B7B7B7B7EA28, 0xD9C5FDFDFDFDD9C5, 0x7AD4939393937AD4, 0x98F22626262698F2, 
            0xD88236363636D882, 0xFCBD3F3F3F3FFCBD, 0xF1F3F7F7F7F7F1F3, 0x1D52CCCCCCCC1D52, 
            0xD08C34343434D08C, 0xA256A5A5A5A5A256, 0xB98DE5E5E5E5B98D, 0xE9E1F1F1F1F1E9E1, 
            0xDF4C71717171DF4C, 0x4D3ED8D8D8D84D3E, 0xC49731313131C497, 0x546B15151515546B, 
            0x101C04040404101C, 0x3163C7C7C7C73163, 0x8CE9232323238CE9, 0x217FC3C3C3C3217F, 
            0x6048181818186048, 0x6ECF969696966ECF, 0x141B05050505141B, 0x5EEB9A9A9A9A5EEB, 
            0x1C15070707071C15, 0x487E12121212487E, 0x36AD8080808036AD, 0xA598E2E2E2E2A598, 
            0x81A7EBEBEBEB81A7, 0x9CF5272727279CF5, 0xFE33B2B2B2B2FE33, 0xCF5075757575CF50, 
            0x243F09090909243F, 0x3AA4838383833AA4, 0xB0C42C2C2C2CB0C4, 0x68461A1A1A1A6846, 
            0x6C411B1B1B1B6C41, 0xA3116E6E6E6EA311, 0x739D5A5A5A5A739D, 0xB64DA0A0A0A0B64D, 
            0x53A55252525253A5, 0xECA13B3B3B3BECA1, 0x7514D6D6D6D67514, 0xFA34B3B3B3B3FA34, 
            0xA4DF29292929A4DF, 0xA19FE3E3E3E3A19F, 0xBCCD2F2F2F2FBCCD, 0x26B18484848426B1, 
            0x57A25353535357A2, 0x6901D1D1D1D16901, 0x0000000000000000, 0x99B5EDEDEDED99B5, 
            0x80E02020202080E0, 0xDDC2FCFCFCFCDDC2, 0xF23AB1B1B1B1F23A, 0x779A5B5B5B5B779A, 
            0xB30D6A6A6A6AB30D, 0x0147CBCBCBCB0147, 0xCE17BEBEBEBECE17, 0xE4AF39393939E4AF, 
            0x33ED4A4A4A4A33ED, 0x2BFF4C4C4C4C2BFF, 0x7B93585858587B93, 0x115BCFCFCFCF115B, 
            0x6D06D0D0D0D06D06, 0x91BBEFEFEFEF91BB, 0x9E7BAAAAAAAA9E7B, 0xC1D7FBFBFBFBC1D7, 
            0x17D24343434317D2, 0x2FF84D4D4D4D2FF8, 0xCC9933333333CC99, 0x22B68585858522B6, 
            0x0FC0454545450FC0, 0xC9D9F9F9F9F9C9D9, 0x080E02020202080E, 0xE7667F7F7F7FE766, 
            0x5BAB505050505BAB, 0xF0B43C3C3C3CF0B4, 0x4AF09F9F9F9F4AF0, 0x9675A8A8A8A89675, 
            0x5FAC515151515FAC, 0xBA44A3A3A3A3BA44, 0x1BDB404040401BDB, 0x0A808F8F8F8F0A80, 
            0x7ED3929292927ED3, 0x42FE9D9D9D9D42FE, 0xE0A838383838E0A8, 0xF9FDF5F5F5F5F9FD, 
            0xC619BCBCBCBCC619, 0xEE2FB6B6B6B6EE2F, 0x4530DADADADA4530, 0x84E72121212184E7, 
            0x4070101010104070, 0xD1CBFFFFFFFFD1CB, 0xE1EFF3F3F3F3E1EF, 0x6508D2D2D2D26508, 
            0x1955CDCDCDCD1955, 0x30240C0C0C0C3024, 0x4C79131313134C79, 0x9DB2ECECECEC9DB2, 
            0x67865F5F5F5F6786, 0x6AC8979797976AC8, 0x0BC7444444440BC7, 0x5C65171717175C65, 
            0x3D6AC4C4C4C43D6A, 0xAA58A7A7A7A7AA58, 0xE3617E7E7E7EE361, 0xF4B33D3D3D3DF4B3, 
            0x8B27646464648B27, 0x6F885D5D5D5D6F88, 0x644F19191919644F, 0xD74273737373D742, 
            0x9B3B606060609B3B, 0x32AA8181818132AA, 0x27F64F4F4F4F27F6, 0x5D22DCDCDCDC5D22, 
            0x88EE2222222288EE, 0xA8D62A2A2A2AA8D6, 0x76DD9090909076DD, 0x1695888888881695, 
            0x03C94646464603C9, 0x95BCEEEEEEEE95BC, 0xD605B8B8B8B8D605, 0x506C14141414506C, 
            0x552CDEDEDEDE552C, 0x63815E5E5E5E6381, 0x2C310B0B0B0B2C31, 0x4137DBDBDBDB4137, 
            0xAD96E0E0E0E0AD96, 0xC89E32323232C89E, 0xE8A63A3A3A3AE8A6, 0x28360A0A0A0A2836, 
            0x3FE4494949493FE4, 0x1812060606061812, 0x90FC2424242490FC, 0x6B8F5C5C5C5C6B8F, 
            0x2578C2C2C2C22578, 0x610FD3D3D3D3610F, 0x8669ACACACAC8669, 0x9335626262629335, 
            0x72DA9191919172DA, 0x62C69595959562C6, 0xBD8AE4E4E4E4BD8A, 0xFF7479797979FF74, 
            0xB183E7E7E7E7B183, 0x0D4EC8C8C8C80D4E, 0xDC8537373737DC85, 0xAF186D6D6D6DAF18, 
            0x028E8D8D8D8D028E, 0x791DD5D5D5D5791D, 0x23F14E4E4E4E23F1, 0x9272A9A9A9A99272, 
            0xAB1F6C6C6C6CAB1F, 0x43B95656565643B9, 0xFDFAF4F4F4F4FDFA, 0x85A0EAEAEAEA85A0, 
            0x8F20656565658F20, 0xF37D7A7A7A7AF37D, 0x8E67AEAEAEAE8E67, 0x2038080808082038, 
            0xDE0BBABABABADE0B, 0xFB7378787878FB73, 0x94FB2525252594FB, 0xB8CA2E2E2E2EB8CA, 
            0x70541C1C1C1C7054, 0xAE5FA6A6A6A6AE5F, 0xE621B4B4B4B4E621, 0x3564C6C6C6C63564, 
            0x8DAEE8E8E8E88DAE, 0x5925DDDDDDDD5925, 0xCB5774747474CB57, 0x7C5D1F1F1F1F7C5D, 
            0x37EA4B4B4B4B37EA, 0xC21EBDBDBDBDC21E, 0x1A9C8B8B8B8B1A9C, 0x1E9B8A8A8A8A1E9B, 
            0xDB4B70707070DB4B, 0xF8BA3E3E3E3EF8BA, 0xE226B5B5B5B5E226, 0x8329666666668329, 
            0x3BE3484848483BE3, 0x0C09030303030C09, 0xF5F4F6F6F6F6F5F4, 0x382A0E0E0E0E382A, 
            0x9F3C616161619F3C, 0xD48B35353535D48B, 0x47BE5757575747BE, 0xD202B9B9B9B9D202, 
            0x2EBF868686862EBF, 0x2971C1C1C1C12971, 0x74531D1D1D1D7453, 0x4EF79E9E9E9E4EF7, 
            0xA991E1E1E1E1A991, 0xCDDEF8F8F8F8CDDE, 0x56E59898989856E5, 0x4477111111114477, 
            0xBF0469696969BF04, 0x4939D9D9D9D94939, 0x0E878E8E8E8E0E87, 0x66C19494949466C1, 
            0x5AEC9B9B9B9B5AEC, 0x785A1E1E1E1E785A, 0x2AB8878787872AB8, 0x89A9E9E9E9E989A9, 
            0x155CCECECECE155C, 0x4FB0555555554FB0, 0xA0D828282828A0D8, 0x512BDFDFDFDF512B, 
            0x06898C8C8C8C0689, 0xB24AA1A1A1A1B24A, 0x1292898989891292, 0x34230D0D0D0D3423, 
            0xCA10BFBFBFBFCA10, 0xB584E6E6E6E6B584, 0x13D54242424213D5, 0xBB0368686868BB03, 
            0x1FDC414141411FDC, 0x52E29999999952E2, 0xB4C32D2D2D2DB4C3, 0x3C2D0F0F0F0F3C2D, 
            0xF63DB0B0B0B0F63D, 0x4BB7545454544BB7, 0xDA0CBBBBBBBBDA0C, 0x5862161616165862
        };

        protected readonly static ulong[] s_aes_style_table3 = 
        {
            0x3263639763973263, 0x6F7C7CEB7CEB6F7C, 0x5E7777C777C75E77, 0x7A7B7BF77BF77A7B, 
            0xE8F2F2E5F2E5E8F2, 0x0A6B6BB76BB70A6B, 0x166F6FA76FA7166F, 0x6DC5C539C5396DC5, 
            0x903030C030C09030, 0x0701010401040701, 0x2E67678767872E67, 0xD12B2BAC2BACD12B, 
            0xCCFEFED5FED5CCFE, 0x13D7D771D77113D7, 0x7CABAB9AAB9A7CAB, 0x597676C376C35976, 
            0x40CACA05CA0540CA, 0xA382823E823EA382, 0x49C9C909C90949C9, 0x687D7DEF7DEF687D, 
            0xD0FAFAC5FAC5D0FA, 0x9459597F597F9459, 0xCE4747074707CE47, 0xE6F0F0EDF0EDE6F0, 
            0x6EADAD82AD826EAD, 0x1AD4D47DD47D1AD4, 0x43A2A2BEA2BE43A2, 0x60AFAF8AAF8A60AF, 
            0xF99C9C469C46F99C, 0x51A4A4A6A4A651A4, 0x457272D372D34572, 0x76C0C02DC02D76C0, 
            0x28B7B7EAB7EA28B7, 0xC5FDFDD9FDD9C5FD, 0xD493937A937AD493, 0xF22626982698F226, 
            0x823636D836D88236, 0xBD3F3FFC3FFCBD3F, 0xF3F7F7F1F7F1F3F7, 0x52CCCC1DCC1D52CC, 
            0x8C3434D034D08C34, 0x56A5A5A2A5A256A5, 0x8DE5E5B9E5B98DE5, 0xE1F1F1E9F1E9E1F1, 
            0x4C7171DF71DF4C71, 0x3ED8D84DD84D3ED8, 0x973131C431C49731, 0x6B15155415546B15, 
            0x1C04041004101C04, 0x63C7C731C73163C7, 0xE923238C238CE923, 0x7FC3C321C3217FC3, 
            0x4818186018604818, 0xCF96966E966ECF96, 0x1B05051405141B05, 0xEB9A9A5E9A5EEB9A, 
            0x1507071C071C1507, 0x7E12124812487E12, 0xAD8080368036AD80, 0x98E2E2A5E2A598E2, 
            0xA7EBEB81EB81A7EB, 0xF527279C279CF527, 0x33B2B2FEB2FE33B2, 0x507575CF75CF5075, 
            0x3F09092409243F09, 0xA483833A833AA483, 0xC42C2CB02CB0C42C, 0x461A1A681A68461A, 
            0x411B1B6C1B6C411B, 0x116E6EA36EA3116E, 0x9D5A5A735A739D5A, 0x4DA0A0B6A0B64DA0, 
            0xA55252535253A552, 0xA13B3BEC3BECA13B, 0x14D6D675D67514D6, 0x34B3B3FAB3FA34B3, 
            0xDF2929A429A4DF29, 0x9FE3E3A1E3A19FE3, 0xCD2F2FBC2FBCCD2F, 0xB18484268426B184, 
            0xA25353575357A253, 0x01D1D169D16901D1, 0x0000000000000000, 0xB5EDED99ED99B5ED, 
            0xE02020802080E020, 0xC2FCFCDDFCDDC2FC, 0x3AB1B1F2B1F23AB1, 0x9A5B5B775B779A5B, 
            0x0D6A6AB36AB30D6A, 0x47CBCB01CB0147CB, 0x17BEBECEBECE17BE, 0xAF3939E439E4AF39, 
            0xED4A4A334A33ED4A, 0xFF4C4C2B4C2BFF4C, 0x9358587B587B9358, 0x5BCFCF11CF115BCF, 
            0x06D0D06DD06D06D0, 0xBBEFEF91EF91BBEF, 0x7BAAAA9EAA9E7BAA, 0xD7FBFBC1FBC1D7FB, 
            0xD24343174317D243, 0xF84D4D2F4D2FF84D, 0x993333CC33CC9933, 0xB68585228522B685, 
            0xC045450F450FC045, 0xD9F9F9C9F9C9D9F9, 0x0E02020802080E02, 0x667F7FE77FE7667F, 
            0xAB50505B505BAB50, 0xB43C3CF03CF0B43C, 0xF09F9F4A9F4AF09F, 0x75A8A896A89675A8, 
            0xAC51515F515FAC51, 0x44A3A3BAA3BA44A3, 0xDB40401B401BDB40, 0x808F8F0A8F0A808F, 
            0xD392927E927ED392, 0xFE9D9D429D42FE9D, 0xA83838E038E0A838, 0xFDF5F5F9F5F9FDF5, 
            0x19BCBCC6BCC619BC, 0x2FB6B6EEB6EE2FB6, 0x30DADA45DA4530DA, 0xE72121842184E721, 
            0x7010104010407010, 0xCBFFFFD1FFD1CBFF, 0xEFF3F3E1F3E1EFF3, 0x08D2D265D26508D2, 
            0x55CDCD19CD1955CD, 0x240C0C300C30240C, 0x7913134C134C7913, 0xB2ECEC9DEC9DB2EC, 
            0x865F5F675F67865F, 0xC897976A976AC897, 0xC744440B440BC744, 0x6517175C175C6517, 
            0x6AC4C43DC43D6AC4, 0x58A7A7AAA7AA58A7, 0x617E7EE37EE3617E, 0xB33D3DF43DF4B33D, 
            0x2764648B648B2764, 0x885D5D6F5D6F885D, 0x4F19196419644F19, 0x427373D773D74273, 
            0x3B60609B609B3B60, 0xAA8181328132AA81, 0xF64F4F274F27F64F, 0x22DCDC5DDC5D22DC, 
            0xEE2222882288EE22, 0xD62A2AA82AA8D62A, 0xDD9090769076DD90, 0x9588881688169588, 
            0xC94646034603C946, 0xBCEEEE95EE95BCEE, 0x05B8B8D6B8D605B8, 0x6C14145014506C14, 
            0x2CDEDE55DE552CDE, 0x815E5E635E63815E, 0x310B0B2C0B2C310B, 0x37DBDB41DB4137DB, 
            0x96E0E0ADE0AD96E0, 0x9E3232C832C89E32, 0xA63A3AE83AE8A63A, 0x360A0A280A28360A, 
            0xE449493F493FE449, 0x1206061806181206, 0xFC2424902490FC24, 0x8F5C5C6B5C6B8F5C, 
            0x78C2C225C22578C2, 0x0FD3D361D3610FD3, 0x69ACAC86AC8669AC, 0x3562629362933562, 
            0xDA9191729172DA91, 0xC69595629562C695, 0x8AE4E4BDE4BD8AE4, 0x747979FF79FF7479, 
            0x83E7E7B1E7B183E7, 0x4EC8C80DC80D4EC8, 0x853737DC37DC8537, 0x186D6DAF6DAF186D, 
            0x8E8D8D028D028E8D, 0x1DD5D579D5791DD5, 0xF14E4E234E23F14E, 0x72A9A992A99272A9, 
            0x1F6C6CAB6CAB1F6C, 0xB95656435643B956, 0xFAF4F4FDF4FDFAF4, 0xA0EAEA85EA85A0EA, 
            0x2065658F658F2065, 0x7D7A7AF37AF37D7A, 0x67AEAE8EAE8E67AE, 0x3808082008203808, 
            0x0BBABADEBADE0BBA, 0x737878FB78FB7378, 0xFB2525942594FB25, 0xCA2E2EB82EB8CA2E, 
            0x541C1C701C70541C, 0x5FA6A6AEA6AE5FA6, 0x21B4B4E6B4E621B4, 0x64C6C635C63564C6, 
            0xAEE8E88DE88DAEE8, 0x25DDDD59DD5925DD, 0x577474CB74CB5774, 0x5D1F1F7C1F7C5D1F, 
            0xEA4B4B374B37EA4B, 0x1EBDBDC2BDC21EBD, 0x9C8B8B1A8B1A9C8B, 0x9B8A8A1E8A1E9B8A, 
            0x4B7070DB70DB4B70, 0xBA3E3EF83EF8BA3E, 0x26B5B5E2B5E226B5, 0x2966668366832966, 
            0xE348483B483BE348, 0x0903030C030C0903, 0xF4F6F6F5F6F5F4F6, 0x2A0E0E380E382A0E, 
            0x3C61619F619F3C61, 0x8B3535D435D48B35, 0xBE5757475747BE57, 0x02B9B9D2B9D202B9, 
            0xBF86862E862EBF86, 0x71C1C129C12971C1, 0x531D1D741D74531D, 0xF79E9E4E9E4EF79E, 
            0x91E1E1A9E1A991E1, 0xDEF8F8CDF8CDDEF8, 0xE59898569856E598, 0x7711114411447711, 
            0x046969BF69BF0469, 0x39D9D949D94939D9, 0x878E8E0E8E0E878E, 0xC19494669466C194, 
            0xEC9B9B5A9B5AEC9B, 0x5A1E1E781E785A1E, 0xB887872A872AB887, 0xA9E9E989E989A9E9, 
            0x5CCECE15CE155CCE, 0xB055554F554FB055, 0xD82828A028A0D828, 0x2BDFDF51DF512BDF, 
            0x898C8C068C06898C, 0x4AA1A1B2A1B24AA1, 0x9289891289129289, 0x230D0D340D34230D, 
            0x10BFBFCABFCA10BF, 0x84E6E6B5E6B584E6, 0xD54242134213D542, 0x036868BB68BB0368, 
            0xDC41411F411FDC41, 0xE29999529952E299, 0xC32D2DB42DB4C32D, 0x2D0F0F3C0F3C2D0F, 
            0x3DB0B0F6B0F63DB0, 0xB754544B544BB754, 0x0CBBBBDABBDA0CBB, 0x6216165816586216
        };
        #endregion

        protected Fugue256Base(HashSize a_hash_size, int a_block_size)
            : base(a_hash_size, a_block_size)
        {
        }

        protected override byte[] GetResult()
        {
            ulong row0, row1, row2, row3;
            ulong col0, col1, col2, col3;
            ulong tmp;
            uint tmp_zero;
            ulong col_0, col_1, col_2, col_3, col_02, col_13;
            uint j1 = (uint)(5 - m_base / 6) % 5;
            int ptr = m_base;

            for (int j = 0; j < 5; j++)
            {
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 4 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 1 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 5 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 2 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 6 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 15 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 4 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 16 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 5 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 17 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 1 + 60) % 30] = (uint)col_13;
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                m_state[((-3 * (2 * ((j1 + j) % 5) + 1)) + 60) % 30] = tmp_zero;
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 4 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 1 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 5 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 2 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 6 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 15 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 4 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 16 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 5 + 60) % 30];
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 17 + 60) % 30] ^= m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 1 + 60) % 30] = (uint)col_13;
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                m_state[((-3 * (2 * ((j1 + j) % 5) + 2)) + 60) % 30] = tmp_zero;
            }

            for (int j = 0; j < 13; j++)
            {
                m_state[(ptr + 4 + 60) % 30] ^= m_state[(ptr + 60) % 30];
                m_state[(ptr + 15 + 60) % 30] ^= m_state[(ptr + 60) % 30];
                ptr = ((ptr - 15 + 30) % 30);
                row0 = col3 = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(m_state[(ptr + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(m_state[(ptr + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(m_state[(ptr + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(m_state[(ptr + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(m_state[(ptr + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                m_state[(ptr + 2 + 60) % 30] = (uint)(col_02 >> 32);
                m_state[(ptr + 1 + 60) % 30] = (uint)col_13;
                m_state[(ptr + 3 + 60) % 30] = (uint)(col_13 >> 32);
                m_state[(ptr + 60) % 30] = tmp_zero;
                m_state[(ptr + 4 + 60) % 30] ^= m_state[(ptr + 60) % 30];
                m_state[(ptr + 16 + 60) % 30] ^= m_state[(ptr + 60) % 30];
                ptr = ((ptr - 14 + 30) % 30);
                row0 = col3 = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(m_state[(ptr + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(m_state[(ptr + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(m_state[(ptr + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(m_state[(ptr + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(m_state[(ptr + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                m_state[(ptr + 2 + 60) % 30] = (uint)(col_02 >> 32);
                m_state[(ptr + 1 + 60) % 30] = (uint)col_13;
                m_state[(ptr + 3 + 60) % 30] = (uint)(col_13 >> 32);
                m_state[(ptr + 60) % 30] = tmp_zero;
            }

            m_state[(ptr + 4 + 60) % 30] ^= m_state[(ptr + 60) % 30];
            m_state[(ptr + 15 + 60) % 30] ^= m_state[(ptr + 60) % 30];

            uint[] result = new uint[HashSize / 4];

            for (int j = 0; j < 4; j++)
            {
                result[j] = m_state[(ptr + 1 + j + 60) % 30];

                if ((j == 3) && (HashSize == 28))
                    continue;

                result[4 + j] = m_state[(ptr + 15 + j + 60) % 30];
            }

            return Converters.ConvertUIntsToBytes(result);
        }

        protected override void TransformBlocks(byte[] a_data, int a_index, int a_length)
        {
            uint[] data32 = Converters.ConvertBytesToUInts(a_data, a_index, (a_length / 4) * 4);

            ulong row0, row1, row2, row3;
            ulong col0, col1, col2, col3;
            ulong col_0, col_1, col_2, col_3, col_02, col_13;
            ulong tmp, tmp_in;
            uint tmp_zero;
            int ptr = m_base;
            int j = 0;
            uint j1 = (uint)(5 - m_base / 6) % 5;

            uint[] state = new uint[30];
            Array.Copy(m_state, state, 30);

            tmp_zero = m_state[(ptr + 60) % 30];

            if ((j1 != 0) && (a_length >= 4))
            {
                if (j1 <= 1)
                {
                    state[((-6 * 1) + 10 + 60) % 30] ^= tmp_zero;
                    state[((-6 * 1) + 60) % 30] = data32[j];
                    state[((-6 * 1) + 8 + 60) % 30] ^= state[((-6 * 1) + 60) % 30];
                    state[((-6 * 1) + 1 + 60) % 30] ^= state[((-6 * 1) + 24 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                    state[((-3 * (2 * 1 + 1)) + 60) % 30] = tmp_zero;
                    state[((-3 * (2 * 1 + 2)) + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                    j++;
                    a_length -= 4;
                    ptr -= 6;
                }

                if ((j1 <= 2) && (a_length >= 4))
                {
                    state[((-6 * 2) + 10 + 60) % 30] ^= tmp_zero;
                    state[((-6 * 2) + 60) % 30] = data32[j];
                    state[((-6 * 2) + 8 + 60) % 30] ^= state[((-6 * 2) + 60) % 30];
                    state[((-6 * 2) + 1 + 60) % 30] ^= state[((-6 * 2) + 24 + 60) % 30];
                    state[((-3 * (2 * 2 + 1)) + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 6 + 60) % 30];
                    state[((-3 * (2 * 2 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 2 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 2 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                    state[((-3 * (2 * 2 + 1)) + 60) % 30] = tmp_zero;
                    state[((-3 * (2 * 2 + 2)) + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                    state[((-3 * (2 * 2 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 2 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 2 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                    j++;
                    a_length -= 4;
                    ptr -= 6;
                }

                if ((j1 <= 3) && (a_length >= 4))
                {
                    state[((-6 * 3) + 10 + 60) % 30] ^= tmp_zero;
                    state[((-6 * 3) + 60) % 30] = data32[j];
                    state[((-6 * 3) + 8 + 60) % 30] ^= state[((-6 * 3) + 60) % 30];
                    state[((-6 * 3) + 1 + 60) % 30] ^= state[((-6 * 3) + 24 + 60) % 30];
                    state[((-3 * (2 * 3 + 1)) + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                    state[((-3 * (2 * 3 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 3 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 3 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                    state[((-3 * (2 * 3 + 1)) + 60) % 30] = tmp_zero;
                    state[((-3 * (2 * 3 + 2)) + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                    state[((-3 * (2 * 3 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 3 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 3 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                    j++;
                    a_length -= 4;
                    ptr -= 6;
                }

                if ((j1 <= 4) && (a_length >= 4))
                {
                    state[((-6 * 4) + 10 + 60) % 30] ^= tmp_zero;
                    state[((-6 * 4) + 60) % 30] = data32[j];
                    state[((-6 * 4) + 8 + 60) % 30] ^= state[((-6 * 4) + 60) % 30];
                    state[((-6 * 4) + 1 + 60) % 30] ^= state[((-6 * 4) + 24 + 60) % 30];
                    state[((-3 * (2 * 4 + 1)) + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 6 + 60) % 30];
                    state[((-3 * (2 * 4 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 4 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 4 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                    state[((-3 * (2 * 4 + 1)) + 60) % 30] = tmp_zero;
                    state[((-3 * (2 * 4 + 2)) + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                    state[((-3 * (2 * 4 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 4 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 4 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                    j++;
                    a_length -= 4;
                    ptr -= 6;
                }
            }

            int len_mod = (a_length / 4) % 10;
            int len_div = (a_length / 4) / 10;

            for (int j2 = 0; j2 < len_div; j2++)
            {
                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 0 + 1 + 60) % 30] ^= state[(-6 * 0 + 24 + 60) % 30];
                state[(-6 * 0 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 0 + 8 + 60) % 30] ^= state[(-6 * 0 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 0 - 3 + 60) % 30] ^= state[(-6 * 0 + 1 + 60) % 30];
                state[(-6 * 0 - 2 + 60) % 30] ^= state[(-6 * 0 + 2 + 60) % 30];
                state[(-6 * 0 - 1 + 60) % 30] ^= state[(-6 * 0 + 3 + 60) % 30];
                state[(-6 * 0 + 12 + 60) % 30] ^= state[(-6 * 0 + 1 + 60) % 30];
                state[(-6 * 0 + 13 + 60) % 30] ^= state[(-6 * 0 + 2 + 60) % 30];
                state[(-6 * 0 + 14 + 60) % 30] ^= state[(-6 * 0 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 0 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 0 + 2)) + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 1 + 8 + 60) % 30] ^= state[(-6 * 1 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 1 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 1 + 1 + 60) % 30] ^= state[(-6 * 1 + 24 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 1 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 1 + 2)) + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 2 + 1 + 60) % 30] ^= state[(-6 * 2 + 24 + 60) % 30];
                state[(-6 * 2 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 2 + 8 + 60) % 30] ^= state[(-6 * 2 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 2 - 3 + 60) % 30] ^= state[(-6 * 2 + 1 + 60) % 30];
                state[(-6 * 2 - 2 + 60) % 30] ^= state[(-6 * 2 + 2 + 60) % 30];
                state[(-6 * 2 - 1 + 60) % 30] ^= state[(-6 * 2 + 3 + 60) % 30];
                state[(-6 * 2 + 12 + 60) % 30] ^= state[(-6 * 2 + 1 + 60) % 30];
                state[(-6 * 2 + 13 + 60) % 30] ^= state[(-6 * 2 + 2 + 60) % 30];
                state[(-6 * 2 + 14 + 60) % 30] ^= state[(-6 * 2 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 2 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 2 + 2)) + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 3 + 8 + 60) % 30] ^= state[(-6 * 3 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 3 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 3 + 1 + 60) % 30] ^= state[(-6 * 3 + 24 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 3 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 3 + 2)) + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 4 + 1 + 60) % 30] ^= state[(-6 * 4 + 24 + 60) % 30];
                state[(-6 * 4 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 4 + 8 + 60) % 30] ^= state[(-6 * 4 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 4 - 3 + 60) % 30] ^= state[(-6 * 4 + 1 + 60) % 30];
                state[(-6 * 4 - 2 + 60) % 30] ^= state[(-6 * 4 + 2 + 60) % 30];
                state[(-6 * 4 - 1 + 60) % 30] ^= state[(-6 * 4 + 3 + 60) % 30];
                state[(-6 * 4 + 12 + 60) % 30] ^= state[(-6 * 4 + 1 + 60) % 30];
                state[(-6 * 4 + 13 + 60) % 30] ^= state[(-6 * 4 + 2 + 60) % 30];
                state[(-6 * 4 + 14 + 60) % 30] ^= state[(-6 * 4 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 4 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 4 + 2)) + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 0 + 8 + 60) % 30] ^= state[(-6 * 0 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 0 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 0 + 1 + 60) % 30] ^= state[(-6 * 0 + 24 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 0 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 0 + 2)) + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 1 + 1 + 60) % 30] ^= state[(-6 * 1 + 24 + 60) % 30];
                state[(-6 * 1 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 1 + 8 + 60) % 30] ^= state[(-6 * 1 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 1 - 3 + 60) % 30] ^= state[(-6 * 1 + 1 + 60) % 30];
                state[(-6 * 1 - 2 + 60) % 30] ^= state[(-6 * 1 + 2 + 60) % 30];
                state[(-6 * 1 - 1 + 60) % 30] ^= state[(-6 * 1 + 3 + 60) % 30];
                state[(-6 * 1 + 12 + 60) % 30] ^= state[(-6 * 1 + 1 + 60) % 30];
                state[(-6 * 1 + 13 + 60) % 30] ^= state[(-6 * 1 + 2 + 60) % 30];
                state[(-6 * 1 + 14 + 60) % 30] ^= state[(-6 * 1 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 1 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 1 + 2)) + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 2 + 8 + 60) % 30] ^= state[(-6 * 2 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 2 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 2 + 1 + 60) % 30] ^= state[(-6 * 2 + 24 + 60) % 30];
                state[((-3 * (2 * 2 + 1)) + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 2 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 2 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 2 + 2)) + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 3 + 1 + 60) % 30] ^= state[(-6 * 3 + 24 + 60) % 30];
                state[(-6 * 3 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 3 + 8 + 60) % 30] ^= state[(-6 * 3 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 3 - 3 + 60) % 30] ^= state[(-6 * 3 + 1 + 60) % 30];
                state[(-6 * 3 - 2 + 60) % 30] ^= state[(-6 * 3 + 2 + 60) % 30];
                state[(-6 * 3 - 1 + 60) % 30] ^= state[(-6 * 3 + 3 + 60) % 30];
                state[(-6 * 3 + 12 + 60) % 30] ^= state[(-6 * 3 + 1 + 60) % 30];
                state[(-6 * 3 + 13 + 60) % 30] ^= state[(-6 * 3 + 2 + 60) % 30];
                state[(-6 * 3 + 14 + 60) % 30] ^= state[(-6 * 3 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 3 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 3 + 2)) + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 4 + 8 + 60) % 30] ^= state[(-6 * 4 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 4 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 4 + 1 + 60) % 30] ^= state[(-6 * 4 + 24 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 4 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 4 + 2)) + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;
            }

            if (len_mod >= 5)
            {
                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 0 + 1 + 60) % 30] ^= state[(-6 * 0 + 24 + 60) % 30];
                state[(-6 * 0 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 0 + 8 + 60) % 30] ^= state[(-6 * 0 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 0 - 3 + 60) % 30] ^= state[(-6 * 0 + 1 + 60) % 30];
                state[(-6 * 0 - 2 + 60) % 30] ^= state[(-6 * 0 + 2 + 60) % 30];
                state[(-6 * 0 - 1 + 60) % 30] ^= state[(-6 * 0 + 3 + 60) % 30];
                state[(-6 * 0 + 12 + 60) % 30] ^= state[(-6 * 0 + 1 + 60) % 30];
                state[(-6 * 0 + 13 + 60) % 30] ^= state[(-6 * 0 + 2 + 60) % 30];
                state[(-6 * 0 + 14 + 60) % 30] ^= state[(-6 * 0 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 0 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 0 + 2)) + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 1 + 8 + 60) % 30] ^= state[(-6 * 1 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 1 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 1 + 1 + 60) % 30] ^= state[(-6 * 1 + 24 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 1 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 1 + 2)) + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 1 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                tmp_in = data32[j] | (ulong)data32[j + 1] << 32;
                state[(-6 * 2 + 1 + 60) % 30] ^= state[(-6 * 2 + 24 + 60) % 30];
                state[(-6 * 2 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 2 + 8 + 60) % 30] ^= state[(-6 * 2 + 60) % 30] = (uint)tmp_in;
                state[(-6 * 2 - 3 + 60) % 30] ^= state[(-6 * 2 + 1 + 60) % 30];
                state[(-6 * 2 - 2 + 60) % 30] ^= state[(-6 * 2 + 2 + 60) % 30];
                state[(-6 * 2 - 1 + 60) % 30] ^= state[(-6 * 2 + 3 + 60) % 30];
                state[(-6 * 2 + 12 + 60) % 30] ^= state[(-6 * 2 + 1 + 60) % 30];
                state[(-6 * 2 + 13 + 60) % 30] ^= state[(-6 * 2 + 2 + 60) % 30];
                state[(-6 * 2 + 14 + 60) % 30] ^= state[(-6 * 2 + 3 + 60) % 30];
                tmp_in = (uint)(tmp_in >> 32);
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 2 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 2 + 2)) + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 2 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[(-6 * 3 + 8 + 60) % 30] ^= state[(-6 * 3 + 60) % 30] = (uint)(tmp_in);
                state[(-6 * 3 + 10 + 60) % 30] ^= tmp_zero;
                state[(-6 * 3 + 1 + 60) % 30] ^= state[(-6 * 3 + 24 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 3 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 3 + 2)) + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 3 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                state[((-6 * 4) + 10 + 60) % 30] ^= tmp_zero;
                state[((-6 * 4) + 60) % 30] = data32[j];
                state[((-6 * 4) + 8 + 60) % 30] ^= state[((-6 * 4) + 60) % 30];
                state[((-6 * 4) + 1 + 60) % 30] ^= state[((-6 * 4) + 24 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 4 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 4 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 4 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 4 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 4 + 2)) + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 4 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 4 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 4 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 4 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 4 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                len_mod = len_mod - 5;
            }

            if (len_mod >= 1)
            {
                state[((-6 * 0) + 10 + 60) % 30] ^= tmp_zero;
                state[((-6 * 0) + 60) % 30] = data32[j];
                state[((-6 * 0) + 8 + 60) % 30] ^= state[((-6 * 0) + 60) % 30];
                state[((-6 * 0) + 1 + 60) % 30] ^= state[((-6 * 0) + 24 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 6 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 0 + 1)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 1)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                state[((-3 * (2 * 0 + 1)) + 60) % 30] = tmp_zero;
                state[((-3 * (2 * 0 + 2)) + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 4 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 5 + 60) % 30];
                state[((-3 * (2 * 0 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 0 + 2)) + 6 + 60) % 30];
                row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30])];
                col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 8)];
                col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 16)];
                col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] >> 24)];
                col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 8)];
                row1 ^= tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 16)];
                row2 ^= tmp;
                col0 ^= tmp;
                col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 60) % 30] >> 24)];
                row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30])];
                col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 8)];
                tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30])];
                tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 16)];
                tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                row0 = row0 >> 8;
                row1 = row1 >> 8;
                row2 = row2 >> 8;
                row3 = row3 << 24;
                col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                tmp_zero = (uint)col_02;
                state[((-3 * (2 * 0 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                state[((-3 * (2 * 0 + 2)) + 1 + 60) % 30] = (uint)col_13;
                state[((-3 * (2 * 0 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                j++;

                if (len_mod >= 2)
                {
                    state[((-6 * 1) + 10 + 60) % 30] ^= tmp_zero;
                    state[((-6 * 1) + 60) % 30] = data32[j];
                    state[((-6 * 1) + 8 + 60) % 30] ^= state[((-6 * 1) + 60) % 30];
                    state[((-6 * 1) + 1 + 60) % 30] ^= state[((-6 * 1) + 24 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 1)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 1 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 1 + 1)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 1 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                    state[((-3 * (2 * 1 + 1)) + 60) % 30] = tmp_zero;
                    state[((-3 * (2 * 1 + 2)) + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 4 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 5 + 60) % 30];
                    state[((-3 * (2 * 1 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 1 + 2)) + 6 + 60) % 30];
                    row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30])];
                    col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 8)];
                    col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 16)];
                    col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] >> 24)];
                    col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col0 ^= tmp;
                    col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 60) % 30] >> 24)];
                    row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30])];
                    col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 8)];
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30])];
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 16)];
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                    col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                    col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                    col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                    col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                    row0 = row0 >> 8;
                    row1 = row1 >> 8;
                    row2 = row2 >> 8;
                    row3 = row3 << 24;
                    col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                    tmp_zero = (uint)col_02;
                    state[((-3 * (2 * 1 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                    state[((-3 * (2 * 1 + 2)) + 1 + 60) % 30] = (uint)col_13;
                    state[((-3 * (2 * 1 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                    j++;

                    if (len_mod >= 3)
                    {
                        state[((-6 * 2) + 10 + 60) % 30] ^= tmp_zero;
                        state[((-6 * 2) + 60) % 30] = data32[j];
                        state[((-6 * 2) + 8 + 60) % 30] ^= state[((-6 * 2) + 60) % 30];
                        state[((-6 * 2) + 1 + 60) % 30] ^= state[((-6 * 2) + 24 + 60) % 30];
                        state[((-3 * (2 * 2 + 1)) + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 4 + 60) % 30];
                        state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 5 + 60) % 30];
                        state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 6 + 60) % 30];
                        state[((-3 * (2 * 2 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 4 + 60) % 30];
                        state[((-3 * (2 * 2 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 5 + 60) % 30];
                        state[((-3 * (2 * 2 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 1)) + 6 + 60) % 30];
                        row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30])];
                        col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 8)];
                        col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 16)];
                        col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] >> 24)];
                        col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30])];
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 8)];
                        row1 ^= tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 16)];
                        row2 ^= tmp;
                        col0 ^= tmp;
                        col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 60) % 30] >> 24)];
                        row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30])];
                        col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 8)];
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] >> 24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30])];
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 16)];
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] >> 24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                        col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                        col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                        col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                        col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                        row0 = row0 >> 8;
                        row1 = row1 >> 8;
                        row2 = row2 >> 8;
                        row3 = row3 << 24;
                        col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                        tmp_zero = (uint)col_02;
                        state[((-3 * (2 * 2 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                        state[((-3 * (2 * 2 + 1)) + 1 + 60) % 30] = (uint)col_13;
                        state[((-3 * (2 * 2 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                        state[((-3 * (2 * 2 + 1)) + 60) % 30] = tmp_zero;
                        state[((-3 * (2 * 2 + 2)) + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                        state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                        state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                        state[((-3 * (2 * 2 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 4 + 60) % 30];
                        state[((-3 * (2 * 2 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 5 + 60) % 30];
                        state[((-3 * (2 * 2 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 2 + 2)) + 6 + 60) % 30];
                        row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30])];
                        col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 8)];
                        col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 16)];
                        col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] >> 24)];
                        col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30])];
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 8)];
                        row1 ^= tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 16)];
                        row2 ^= tmp;
                        col0 ^= tmp;
                        col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 60) % 30] >> 24)];
                        row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30])];
                        col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 8)];
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] >> 24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30])];
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 16)];
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] >> 24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                        col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                        col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                        col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                        col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                        row0 = row0 >> 8;
                        row1 = row1 >> 8;
                        row2 = row2 >> 8;
                        row3 = row3 << 24;
                        col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                        tmp_zero = (uint)col_02;
                        state[((-3 * (2 * 2 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                        state[((-3 * (2 * 2 + 2)) + 1 + 60) % 30] = (uint)col_13;
                        state[((-3 * (2 * 2 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                        j++;

                        if (len_mod >= 4)
                        {
                            state[((-6 * 3) + 10 + 60) % 30] ^= tmp_zero;
                            state[((-6 * 3) + 60) % 30] = data32[j];
                            state[((-6 * 3) + 8 + 60) % 30] ^= state[((-6 * 3) + 60) % 30];
                            state[((-6 * 3) + 1 + 60) % 30] ^= state[((-6 * 3) + 24 + 60) % 30];
                            state[((-3 * (2 * 3 + 1)) + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                            state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                            state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                            state[((-3 * (2 * 3 + 1)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 4 + 60) % 30];
                            state[((-3 * (2 * 3 + 1)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 5 + 60) % 30];
                            state[((-3 * (2 * 3 + 1)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 1)) + 6 + 60) % 30];
                            row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30])];
                            col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 8)];
                            col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 16)];
                            col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] >> 24)];
                            col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30])];
                            tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 8)];
                            row1 ^= tmp;
                            col0 ^= tmp;
                            tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 16)];
                            row2 ^= tmp;
                            col0 ^= tmp;
                            col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 60) % 30] >> 24)];
                            row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30])];
                            col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 8)];
                            tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 16)];
                            row2 ^= tmp;
                            col1 ^= tmp;
                            tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] >> 24)];
                            row3 ^= tmp;
                            col1 ^= tmp;
                            row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30])];
                            tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 8)];
                            row1 ^= tmp;
                            col2 ^= tmp;
                            col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 16)];
                            tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] >> 24)];
                            row3 ^= tmp;
                            col2 ^= tmp;
                            col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                            col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                            col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                            col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                            col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                            row0 = row0 >> 8;
                            row1 = row1 >> 8;
                            row2 = row2 >> 8;
                            row3 = row3 << 24;
                            col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                            tmp_zero = (uint)col_02;
                            state[((-3 * (2 * 3 + 1)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                            state[((-3 * (2 * 3 + 1)) + 1 + 60) % 30] = (uint)col_13;
                            state[((-3 * (2 * 3 + 1)) + 3 + 60) % 30] = (uint)(col_13 >> 32);
                            state[((-3 * (2 * 3 + 1)) + 60) % 30] = tmp_zero;
                            state[((-3 * (2 * 3 + 2)) + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                            state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                            state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                            state[((-3 * (2 * 3 + 2)) + 15 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 4 + 60) % 30];
                            state[((-3 * (2 * 3 + 2)) + 16 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 5 + 60) % 30];
                            state[((-3 * (2 * 3 + 2)) + 17 + 60) % 30] ^= state[((-3 * (2 * 3 + 2)) + 6 + 60) % 30];
                            row0 = col3 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30])];
                            col3 ^= row1 = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 8)];
                            col3 ^= row2 = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 16)];
                            col3 ^= s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] >> 24)];
                            col0 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30])];
                            tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 8)];
                            row1 ^= tmp;
                            col0 ^= tmp;
                            tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 16)];
                            row2 ^= tmp;
                            col0 ^= tmp;
                            col0 ^= row3 = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 60) % 30] >> 24)];
                            row0 ^= col1 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30])];
                            col1 ^= s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 8)];
                            tmp = s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 16)];
                            row2 ^= tmp;
                            col1 ^= tmp;
                            tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] >> 24)];
                            row3 ^= tmp;
                            col1 ^= tmp;
                            row0 ^= col2 = s_aes_style_table0[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30])];
                            tmp = s_aes_style_table1[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 8)];
                            row1 ^= tmp;
                            col2 ^= tmp;
                            col2 ^= s_aes_style_table2[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 16)];
                            tmp = s_aes_style_table3[(byte)(state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] >> 24)];
                            row3 ^= tmp;
                            col2 ^= tmp;
                            col_0 = (uint)col0 ^ ((ulong)col2 << 32);
                            col_1 = (uint)col1 ^ ((ulong)col3 << 32);
                            col_2 = (uint)col2 ^ ((ulong)col0 << 32);
                            col_3 = (uint)col3 ^ ((ulong)col1 << 32);
                            col_02 = ((row0 ^ col_0) & 0x000000ff000000ff) ^ ((row1 ^ col_1) & 0x0000ff000000ff00) ^ ((row2 ^ col_2) & 0x00ff000000ff0000) ^ ((row3 ^ col_3) & 0xff000000ff000000);
                            row0 = row0 >> 8;
                            row1 = row1 >> 8;
                            row2 = row2 >> 8;
                            row3 = row3 << 24;
                            col_13 = ((row0 ^ col_1) & 0x000000ff000000ff) ^ ((row1 ^ col_2) & 0x0000ff000000ff00) ^ ((row2 ^ col_3) & 0x00ff000000ff0000) ^ ((row3 ^ col_0) & 0xff000000ff000000);
                            tmp_zero = (uint)col_02;
                            state[((-3 * (2 * 3 + 2)) + 2 + 60) % 30] = (uint)(col_02 >> 32);
                            state[((-3 * (2 * 3 + 2)) + 1 + 60) % 30] = (uint)col_13;
                            state[((-3 * (2 * 3 + 2)) + 3 + 60) % 30] = (uint)(col_13 >> 32);

                            j++;
                        }
                    }
                }
            }

            state[(ptr - 6 * len_mod + 60) % 30] = tmp_zero;
            m_base = (ptr - 6 * len_mod + 2 * 30) % 30;

            Array.Copy(state, m_state, 30);
        }
    };

    internal class Fugue224 : Fugue256Base
    {
        #region Consts
        private readonly static uint[] s_IV224 = 
            {
                0x0D12C9F4, 0x57F78662, 0x1CE039EE, 0xCBE374E0, 
                0x627C12A1, 0x15D2439A, 0x9A678DBD
            };
        #endregion

        public Fugue224()
            : base(NBitcoin.Altcoins.HashX11.HashSize.HashSize224, 30)
        {
        }

        public override void Initialize()
        {
            base.Initialize();

            Array.Copy(s_IV224, 0, m_state, BlockSize - s_IV224.Length, s_IV224.Length);
        }
    };

    internal class Fugue256 : Fugue256Base
    {
        #region Consts
        private readonly static uint[] s_IV256 = 
            {
                0xDEBD52E9, 0x5F137166, 0x68F6D4E0, 0x94B5B0D2, 
                0x1D626CF9, 0xDE29F9FB, 0x99E84991, 0x48C2F834
            };
        #endregion

        public Fugue256()
            : base(NBitcoin.Altcoins.HashX11.HashSize.HashSize256, 30)
        {
        }

        public override void Initialize()
        {
            base.Initialize();

            Array.Copy(s_IV256, 0, m_state, BlockSize - s_IV256.Length, s_IV256.Length);
        }
    };

    internal abstract class Fugue512Base : FugueBase
    {
        #region Consts
        protected readonly static uint[] s_aes_style_table0 = 
        {
            0x97326363, 0xEB6F7C7C, 0xC75E7777, 0xF77A7B7B, 0xE5E8F2F2, 0xB70A6B6B, 0xA7166F6F, 0x396DC5C5, 
            0xC0903030, 0x04070101, 0x872E6767, 0xACD12B2B, 0xD5CCFEFE, 0x7113D7D7, 0x9A7CABAB, 0xC3597676, 
            0x0540CACA, 0x3EA38282, 0x0949C9C9, 0xEF687D7D, 0xC5D0FAFA, 0x7F945959, 0x07CE4747, 0xEDE6F0F0, 
            0x826EADAD, 0x7D1AD4D4, 0xBE43A2A2, 0x8A60AFAF, 0x46F99C9C, 0xA651A4A4, 0xD3457272, 0x2D76C0C0, 
            0xEA28B7B7, 0xD9C5FDFD, 0x7AD49393, 0x98F22626, 0xD8823636, 0xFCBD3F3F, 0xF1F3F7F7, 0x1D52CCCC, 
            0xD08C3434, 0xA256A5A5, 0xB98DE5E5, 0xE9E1F1F1, 0xDF4C7171, 0x4D3ED8D8, 0xC4973131, 0x546B1515, 
            0x101C0404, 0x3163C7C7, 0x8CE92323, 0x217FC3C3, 0x60481818, 0x6ECF9696, 0x141B0505, 0x5EEB9A9A, 
            0x1C150707, 0x487E1212, 0x36AD8080, 0xA598E2E2, 0x81A7EBEB, 0x9CF52727, 0xFE33B2B2, 0xCF507575, 
            0x243F0909, 0x3AA48383, 0xB0C42C2C, 0x68461A1A, 0x6C411B1B, 0xA3116E6E, 0x739D5A5A, 0xB64DA0A0, 
            0x53A55252, 0xECA13B3B, 0x7514D6D6, 0xFA34B3B3, 0xA4DF2929, 0xA19FE3E3, 0xBCCD2F2F, 0x26B18484, 
            0x57A25353, 0x6901D1D1, 0x00000000, 0x99B5EDED, 0x80E02020, 0xDDC2FCFC, 0xF23AB1B1, 0x779A5B5B, 
            0xB30D6A6A, 0x0147CBCB, 0xCE17BEBE, 0xE4AF3939, 0x33ED4A4A, 0x2BFF4C4C, 0x7B935858, 0x115BCFCF, 
            0x6D06D0D0, 0x91BBEFEF, 0x9E7BAAAA, 0xC1D7FBFB, 0x17D24343, 0x2FF84D4D, 0xCC993333, 0x22B68585, 
            0x0FC04545, 0xC9D9F9F9, 0x080E0202, 0xE7667F7F, 0x5BAB5050, 0xF0B43C3C, 0x4AF09F9F, 0x9675A8A8, 
            0x5FAC5151, 0xBA44A3A3, 0x1BDB4040, 0x0A808F8F, 0x7ED39292, 0x42FE9D9D, 0xE0A83838, 0xF9FDF5F5, 
            0xC619BCBC, 0xEE2FB6B6, 0x4530DADA, 0x84E72121, 0x40701010, 0xD1CBFFFF, 0xE1EFF3F3, 0x6508D2D2, 
            0x1955CDCD, 0x30240C0C, 0x4C791313, 0x9DB2ECEC, 0x67865F5F, 0x6AC89797, 0x0BC74444, 0x5C651717, 
            0x3D6AC4C4, 0xAA58A7A7, 0xE3617E7E, 0xF4B33D3D, 0x8B276464, 0x6F885D5D, 0x644F1919, 0xD7427373, 
            0x9B3B6060, 0x32AA8181, 0x27F64F4F, 0x5D22DCDC, 0x88EE2222, 0xA8D62A2A, 0x76DD9090, 0x16958888, 
            0x03C94646, 0x95BCEEEE, 0xD605B8B8, 0x506C1414, 0x552CDEDE, 0x63815E5E, 0x2C310B0B, 0x4137DBDB, 
            0xAD96E0E0, 0xC89E3232, 0xE8A63A3A, 0x28360A0A, 0x3FE44949, 0x18120606, 0x90FC2424, 0x6B8F5C5C, 
            0x2578C2C2, 0x610FD3D3, 0x8669ACAC, 0x93356262, 0x72DA9191, 0x62C69595, 0xBD8AE4E4, 0xFF747979, 
            0xB183E7E7, 0x0D4EC8C8, 0xDC853737, 0xAF186D6D, 0x028E8D8D, 0x791DD5D5, 0x23F14E4E, 0x9272A9A9, 
            0xAB1F6C6C, 0x43B95656, 0xFDFAF4F4, 0x85A0EAEA, 0x8F206565, 0xF37D7A7A, 0x8E67AEAE, 0x20380808, 
            0xDE0BBABA, 0xFB737878, 0x94FB2525, 0xB8CA2E2E, 0x70541C1C, 0xAE5FA6A6, 0xE621B4B4, 0x3564C6C6, 
            0x8DAEE8E8, 0x5925DDDD, 0xCB577474, 0x7C5D1F1F, 0x37EA4B4B, 0xC21EBDBD, 0x1A9C8B8B, 0x1E9B8A8A, 
            0xDB4B7070, 0xF8BA3E3E, 0xE226B5B5, 0x83296666, 0x3BE34848, 0x0C090303, 0xF5F4F6F6, 0x382A0E0E, 
            0x9F3C6161, 0xD48B3535, 0x47BE5757, 0xD202B9B9, 0x2EBF8686, 0x2971C1C1, 0x74531D1D, 0x4EF79E9E, 
            0xA991E1E1, 0xCDDEF8F8, 0x56E59898, 0x44771111, 0xBF046969, 0x4939D9D9, 0x0E878E8E, 0x66C19494, 
            0x5AEC9B9B, 0x785A1E1E, 0x2AB88787, 0x89A9E9E9, 0x155CCECE, 0x4FB05555, 0xA0D82828, 0x512BDFDF, 
            0x06898C8C, 0xB24AA1A1, 0x12928989, 0x34230D0D, 0xCA10BFBF, 0xB584E6E6, 0x13D54242, 0xBB036868, 
            0x1FDC4141, 0x52E29999, 0xB4C32D2D, 0x3C2D0F0F, 0xF63DB0B0, 0x4BB75454, 0xDA0CBBBB, 0x58621616
        };

        protected readonly static uint[] s_aes_style_table1 = 
        {
            0x32636397, 0x6F7C7CEB, 0x5E7777C7, 0x7A7B7BF7, 0xE8F2F2E5, 0x0A6B6BB7, 0x166F6FA7, 0x6DC5C539, 
            0x903030C0, 0x07010104, 0x2E676787, 0xD12B2BAC, 0xCCFEFED5, 0x13D7D771, 0x7CABAB9A, 0x597676C3, 
            0x40CACA05, 0xA382823E, 0x49C9C909, 0x687D7DEF, 0xD0FAFAC5, 0x9459597F, 0xCE474707, 0xE6F0F0ED, 
            0x6EADAD82, 0x1AD4D47D, 0x43A2A2BE, 0x60AFAF8A, 0xF99C9C46, 0x51A4A4A6, 0x457272D3, 0x76C0C02D, 
            0x28B7B7EA, 0xC5FDFDD9, 0xD493937A, 0xF2262698, 0x823636D8, 0xBD3F3FFC, 0xF3F7F7F1, 0x52CCCC1D, 
            0x8C3434D0, 0x56A5A5A2, 0x8DE5E5B9, 0xE1F1F1E9, 0x4C7171DF, 0x3ED8D84D, 0x973131C4, 0x6B151554, 
            0x1C040410, 0x63C7C731, 0xE923238C, 0x7FC3C321, 0x48181860, 0xCF96966E, 0x1B050514, 0xEB9A9A5E, 
            0x1507071C, 0x7E121248, 0xAD808036, 0x98E2E2A5, 0xA7EBEB81, 0xF527279C, 0x33B2B2FE, 0x507575CF, 
            0x3F090924, 0xA483833A, 0xC42C2CB0, 0x461A1A68, 0x411B1B6C, 0x116E6EA3, 0x9D5A5A73, 0x4DA0A0B6, 
            0xA5525253, 0xA13B3BEC, 0x14D6D675, 0x34B3B3FA, 0xDF2929A4, 0x9FE3E3A1, 0xCD2F2FBC, 0xB1848426, 
            0xA2535357, 0x01D1D169, 0x00000000, 0xB5EDED99, 0xE0202080, 0xC2FCFCDD, 0x3AB1B1F2, 0x9A5B5B77, 
            0x0D6A6AB3, 0x47CBCB01, 0x17BEBECE, 0xAF3939E4, 0xED4A4A33, 0xFF4C4C2B, 0x9358587B, 0x5BCFCF11, 
            0x06D0D06D, 0xBBEFEF91, 0x7BAAAA9E, 0xD7FBFBC1, 0xD2434317, 0xF84D4D2F, 0x993333CC, 0xB6858522, 
            0xC045450F, 0xD9F9F9C9, 0x0E020208, 0x667F7FE7, 0xAB50505B, 0xB43C3CF0, 0xF09F9F4A, 0x75A8A896, 
            0xAC51515F, 0x44A3A3BA, 0xDB40401B, 0x808F8F0A, 0xD392927E, 0xFE9D9D42, 0xA83838E0, 0xFDF5F5F9, 
            0x19BCBCC6, 0x2FB6B6EE, 0x30DADA45, 0xE7212184, 0x70101040, 0xCBFFFFD1, 0xEFF3F3E1, 0x08D2D265, 
            0x55CDCD19, 0x240C0C30, 0x7913134C, 0xB2ECEC9D, 0x865F5F67, 0xC897976A, 0xC744440B, 0x6517175C, 
            0x6AC4C43D, 0x58A7A7AA, 0x617E7EE3, 0xB33D3DF4, 0x2764648B, 0x885D5D6F, 0x4F191964, 0x427373D7, 
            0x3B60609B, 0xAA818132, 0xF64F4F27, 0x22DCDC5D, 0xEE222288, 0xD62A2AA8, 0xDD909076, 0x95888816, 
            0xC9464603, 0xBCEEEE95, 0x05B8B8D6, 0x6C141450, 0x2CDEDE55, 0x815E5E63, 0x310B0B2C, 0x37DBDB41, 
            0x96E0E0AD, 0x9E3232C8, 0xA63A3AE8, 0x360A0A28, 0xE449493F, 0x12060618, 0xFC242490, 0x8F5C5C6B, 
            0x78C2C225, 0x0FD3D361, 0x69ACAC86, 0x35626293, 0xDA919172, 0xC6959562, 0x8AE4E4BD, 0x747979FF, 
            0x83E7E7B1, 0x4EC8C80D, 0x853737DC, 0x186D6DAF, 0x8E8D8D02, 0x1DD5D579, 0xF14E4E23, 0x72A9A992, 
            0x1F6C6CAB, 0xB9565643, 0xFAF4F4FD, 0xA0EAEA85, 0x2065658F, 0x7D7A7AF3, 0x67AEAE8E, 0x38080820, 
            0x0BBABADE, 0x737878FB, 0xFB252594, 0xCA2E2EB8, 0x541C1C70, 0x5FA6A6AE, 0x21B4B4E6, 0x64C6C635, 
            0xAEE8E88D, 0x25DDDD59, 0x577474CB, 0x5D1F1F7C, 0xEA4B4B37, 0x1EBDBDC2, 0x9C8B8B1A, 0x9B8A8A1E, 
            0x4B7070DB, 0xBA3E3EF8, 0x26B5B5E2, 0x29666683, 0xE348483B, 0x0903030C, 0xF4F6F6F5, 0x2A0E0E38, 
            0x3C61619F, 0x8B3535D4, 0xBE575747, 0x02B9B9D2, 0xBF86862E, 0x71C1C129, 0x531D1D74, 0xF79E9E4E, 
            0x91E1E1A9, 0xDEF8F8CD, 0xE5989856, 0x77111144, 0x046969BF, 0x39D9D949, 0x878E8E0E, 0xC1949466, 
            0xEC9B9B5A, 0x5A1E1E78, 0xB887872A, 0xA9E9E989, 0x5CCECE15, 0xB055554F, 0xD82828A0, 0x2BDFDF51, 
            0x898C8C06, 0x4AA1A1B2, 0x92898912, 0x230D0D34, 0x10BFBFCA, 0x84E6E6B5, 0xD5424213, 0x036868BB, 
            0xDC41411F, 0xE2999952, 0xC32D2DB4, 0x2D0F0F3C, 0x3DB0B0F6, 0xB754544B, 0x0CBBBBDA, 0x62161658
        };

        protected readonly static uint[] s_aes_style_table2 = 
        {
            0x63639732, 0x7C7CEB6F, 0x7777C75E, 0x7B7BF77A, 0xF2F2E5E8, 0x6B6BB70A, 0x6F6FA716, 0xC5C5396D, 
            0x3030C090, 0x01010407, 0x6767872E, 0x2B2BACD1, 0xFEFED5CC, 0xD7D77113, 0xABAB9A7C, 0x7676C359, 
            0xCACA0540, 0x82823EA3, 0xC9C90949, 0x7D7DEF68, 0xFAFAC5D0, 0x59597F94, 0x474707CE, 0xF0F0EDE6, 
            0xADAD826E, 0xD4D47D1A, 0xA2A2BE43, 0xAFAF8A60, 0x9C9C46F9, 0xA4A4A651, 0x7272D345, 0xC0C02D76, 
            0xB7B7EA28, 0xFDFDD9C5, 0x93937AD4, 0x262698F2, 0x3636D882, 0x3F3FFCBD, 0xF7F7F1F3, 0xCCCC1D52, 
            0x3434D08C, 0xA5A5A256, 0xE5E5B98D, 0xF1F1E9E1, 0x7171DF4C, 0xD8D84D3E, 0x3131C497, 0x1515546B, 
            0x0404101C, 0xC7C73163, 0x23238CE9, 0xC3C3217F, 0x18186048, 0x96966ECF, 0x0505141B, 0x9A9A5EEB, 
            0x07071C15, 0x1212487E, 0x808036AD, 0xE2E2A598, 0xEBEB81A7, 0x27279CF5, 0xB2B2FE33, 0x7575CF50, 
            0x0909243F, 0x83833AA4, 0x2C2CB0C4, 0x1A1A6846, 0x1B1B6C41, 0x6E6EA311, 0x5A5A739D, 0xA0A0B64D, 
            0x525253A5, 0x3B3BECA1, 0xD6D67514, 0xB3B3FA34, 0x2929A4DF, 0xE3E3A19F, 0x2F2FBCCD, 0x848426B1, 
            0x535357A2, 0xD1D16901, 0x00000000, 0xEDED99B5, 0x202080E0, 0xFCFCDDC2, 0xB1B1F23A, 0x5B5B779A, 
            0x6A6AB30D, 0xCBCB0147, 0xBEBECE17, 0x3939E4AF, 0x4A4A33ED, 0x4C4C2BFF, 0x58587B93, 0xCFCF115B, 
            0xD0D06D06, 0xEFEF91BB, 0xAAAA9E7B, 0xFBFBC1D7, 0x434317D2, 0x4D4D2FF8, 0x3333CC99, 0x858522B6, 
            0x45450FC0, 0xF9F9C9D9, 0x0202080E, 0x7F7FE766, 0x50505BAB, 0x3C3CF0B4, 0x9F9F4AF0, 0xA8A89675, 
            0x51515FAC, 0xA3A3BA44, 0x40401BDB, 0x8F8F0A80, 0x92927ED3, 0x9D9D42FE, 0x3838E0A8, 0xF5F5F9FD, 
            0xBCBCC619, 0xB6B6EE2F, 0xDADA4530, 0x212184E7, 0x10104070, 0xFFFFD1CB, 0xF3F3E1EF, 0xD2D26508, 
            0xCDCD1955, 0x0C0C3024, 0x13134C79, 0xECEC9DB2, 0x5F5F6786, 0x97976AC8, 0x44440BC7, 0x17175C65, 
            0xC4C43D6A, 0xA7A7AA58, 0x7E7EE361, 0x3D3DF4B3, 0x64648B27, 0x5D5D6F88, 0x1919644F, 0x7373D742, 
            0x60609B3B, 0x818132AA, 0x4F4F27F6, 0xDCDC5D22, 0x222288EE, 0x2A2AA8D6, 0x909076DD, 0x88881695, 
            0x464603C9, 0xEEEE95BC, 0xB8B8D605, 0x1414506C, 0xDEDE552C, 0x5E5E6381, 0x0B0B2C31, 0xDBDB4137, 
            0xE0E0AD96, 0x3232C89E, 0x3A3AE8A6, 0x0A0A2836, 0x49493FE4, 0x06061812, 0x242490FC, 0x5C5C6B8F, 
            0xC2C22578, 0xD3D3610F, 0xACAC8669, 0x62629335, 0x919172DA, 0x959562C6, 0xE4E4BD8A, 0x7979FF74, 
            0xE7E7B183, 0xC8C80D4E, 0x3737DC85, 0x6D6DAF18, 0x8D8D028E, 0xD5D5791D, 0x4E4E23F1, 0xA9A99272, 
            0x6C6CAB1F, 0x565643B9, 0xF4F4FDFA, 0xEAEA85A0, 0x65658F20, 0x7A7AF37D, 0xAEAE8E67, 0x08082038, 
            0xBABADE0B, 0x7878FB73, 0x252594FB, 0x2E2EB8CA, 0x1C1C7054, 0xA6A6AE5F, 0xB4B4E621, 0xC6C63564, 
            0xE8E88DAE, 0xDDDD5925, 0x7474CB57, 0x1F1F7C5D, 0x4B4B37EA, 0xBDBDC21E, 0x8B8B1A9C, 0x8A8A1E9B, 
            0x7070DB4B, 0x3E3EF8BA, 0xB5B5E226, 0x66668329, 0x48483BE3, 0x03030C09, 0xF6F6F5F4, 0x0E0E382A, 
            0x61619F3C, 0x3535D48B, 0x575747BE, 0xB9B9D202, 0x86862EBF, 0xC1C12971, 0x1D1D7453, 0x9E9E4EF7, 
            0xE1E1A991, 0xF8F8CDDE, 0x989856E5, 0x11114477, 0x6969BF04, 0xD9D94939, 0x8E8E0E87, 0x949466C1, 
            0x9B9B5AEC, 0x1E1E785A, 0x87872AB8, 0xE9E989A9, 0xCECE155C, 0x55554FB0, 0x2828A0D8, 0xDFDF512B, 
            0x8C8C0689, 0xA1A1B24A, 0x89891292, 0x0D0D3423, 0xBFBFCA10, 0xE6E6B584, 0x424213D5, 0x6868BB03, 
            0x41411FDC, 0x999952E2, 0x2D2DB4C3, 0x0F0F3C2D, 0xB0B0F63D, 0x54544BB7, 0xBBBBDA0C, 0x16165862
        };

        protected readonly static uint[] s_aes_style_table3 = 
        {
            0x63973263, 0x7CEB6F7C, 0x77C75E77, 0x7BF77A7B, 0xF2E5E8F2, 0x6BB70A6B, 0x6FA7166F, 0xC5396DC5, 
            0x30C09030, 0x01040701, 0x67872E67, 0x2BACD12B, 0xFED5CCFE, 0xD77113D7, 0xAB9A7CAB, 0x76C35976, 
            0xCA0540CA, 0x823EA382, 0xC90949C9, 0x7DEF687D, 0xFAC5D0FA, 0x597F9459, 0x4707CE47, 0xF0EDE6F0, 
            0xAD826EAD, 0xD47D1AD4, 0xA2BE43A2, 0xAF8A60AF, 0x9C46F99C, 0xA4A651A4, 0x72D34572, 0xC02D76C0, 
            0xB7EA28B7, 0xFDD9C5FD, 0x937AD493, 0x2698F226, 0x36D88236, 0x3FFCBD3F, 0xF7F1F3F7, 0xCC1D52CC, 
            0x34D08C34, 0xA5A256A5, 0xE5B98DE5, 0xF1E9E1F1, 0x71DF4C71, 0xD84D3ED8, 0x31C49731, 0x15546B15, 
            0x04101C04, 0xC73163C7, 0x238CE923, 0xC3217FC3, 0x18604818, 0x966ECF96, 0x05141B05, 0x9A5EEB9A, 
            0x071C1507, 0x12487E12, 0x8036AD80, 0xE2A598E2, 0xEB81A7EB, 0x279CF527, 0xB2FE33B2, 0x75CF5075, 
            0x09243F09, 0x833AA483, 0x2CB0C42C, 0x1A68461A, 0x1B6C411B, 0x6EA3116E, 0x5A739D5A, 0xA0B64DA0, 
            0x5253A552, 0x3BECA13B, 0xD67514D6, 0xB3FA34B3, 0x29A4DF29, 0xE3A19FE3, 0x2FBCCD2F, 0x8426B184, 
            0x5357A253, 0xD16901D1, 0x00000000, 0xED99B5ED, 0x2080E020, 0xFCDDC2FC, 0xB1F23AB1, 0x5B779A5B, 
            0x6AB30D6A, 0xCB0147CB, 0xBECE17BE, 0x39E4AF39, 0x4A33ED4A, 0x4C2BFF4C, 0x587B9358, 0xCF115BCF, 
            0xD06D06D0, 0xEF91BBEF, 0xAA9E7BAA, 0xFBC1D7FB, 0x4317D243, 0x4D2FF84D, 0x33CC9933, 0x8522B685, 
            0x450FC045, 0xF9C9D9F9, 0x02080E02, 0x7FE7667F, 0x505BAB50, 0x3CF0B43C, 0x9F4AF09F, 0xA89675A8, 
            0x515FAC51, 0xA3BA44A3, 0x401BDB40, 0x8F0A808F, 0x927ED392, 0x9D42FE9D, 0x38E0A838, 0xF5F9FDF5, 
            0xBCC619BC, 0xB6EE2FB6, 0xDA4530DA, 0x2184E721, 0x10407010, 0xFFD1CBFF, 0xF3E1EFF3, 0xD26508D2, 
            0xCD1955CD, 0x0C30240C, 0x134C7913, 0xEC9DB2EC, 0x5F67865F, 0x976AC897, 0x440BC744, 0x175C6517, 
            0xC43D6AC4, 0xA7AA58A7, 0x7EE3617E, 0x3DF4B33D, 0x648B2764, 0x5D6F885D, 0x19644F19, 0x73D74273, 
            0x609B3B60, 0x8132AA81, 0x4F27F64F, 0xDC5D22DC, 0x2288EE22, 0x2AA8D62A, 0x9076DD90, 0x88169588, 
            0x4603C946, 0xEE95BCEE, 0xB8D605B8, 0x14506C14, 0xDE552CDE, 0x5E63815E, 0x0B2C310B, 0xDB4137DB, 
            0xE0AD96E0, 0x32C89E32, 0x3AE8A63A, 0x0A28360A, 0x493FE449, 0x06181206, 0x2490FC24, 0x5C6B8F5C, 
            0xC22578C2, 0xD3610FD3, 0xAC8669AC, 0x62933562, 0x9172DA91, 0x9562C695, 0xE4BD8AE4, 0x79FF7479, 
            0xE7B183E7, 0xC80D4EC8, 0x37DC8537, 0x6DAF186D, 0x8D028E8D, 0xD5791DD5, 0x4E23F14E, 0xA99272A9, 
            0x6CAB1F6C, 0x5643B956, 0xF4FDFAF4, 0xEA85A0EA, 0x658F2065, 0x7AF37D7A, 0xAE8E67AE, 0x08203808, 
            0xBADE0BBA, 0x78FB7378, 0x2594FB25, 0x2EB8CA2E, 0x1C70541C, 0xA6AE5FA6, 0xB4E621B4, 0xC63564C6, 
            0xE88DAEE8, 0xDD5925DD, 0x74CB5774, 0x1F7C5D1F, 0x4B37EA4B, 0xBDC21EBD, 0x8B1A9C8B, 0x8A1E9B8A, 
            0x70DB4B70, 0x3EF8BA3E, 0xB5E226B5, 0x66832966, 0x483BE348, 0x030C0903, 0xF6F5F4F6, 0x0E382A0E, 
            0x619F3C61, 0x35D48B35, 0x5747BE57, 0xB9D202B9, 0x862EBF86, 0xC12971C1, 0x1D74531D, 0x9E4EF79E, 
            0xE1A991E1, 0xF8CDDEF8, 0x9856E598, 0x11447711, 0x69BF0469, 0xD94939D9, 0x8E0E878E, 0x9466C194, 
            0x9B5AEC9B, 0x1E785A1E, 0x872AB887, 0xE989A9E9, 0xCE155CCE, 0x554FB055, 0x28A0D828, 0xDF512BDF, 
            0x8C06898C, 0xA1B24AA1, 0x89129289, 0x0D34230D, 0xBFCA10BF, 0xE6B584E6, 0x4213D542, 0x68BB0368, 
            0x411FDC41, 0x9952E299, 0x2DB4C32D, 0x0F3C2D0F, 0xB0F63DB0, 0x544BB754, 0xBBDA0CBB, 0x16586216
        };
        #endregion

        protected Fugue512Base(HashSize a_hash_size, int a_block_size)
            : base(a_hash_size, a_block_size)
        {
        }
    };

    internal class Fugue384 : Fugue512Base
    {
        #region Consts
        private readonly static uint[] s_IV384 = 
            {
                0x0DEC61AA, 0x1F2E2531, 0xC7B41DA0, 0x85096000, 
                0x4AF45E21, 0x9C5E1B74, 0x9A3E69FA, 0x40B03E47, 
                0x8AAE02E5, 0xE0259CA9, 0x7C5195BC, 0xA195105C
            };
        #endregion

        protected override byte[] GetResult()
        {
            uint row0, row1, row2, row3;
            uint col0, col1, col2, col3;
            uint tmp;
            uint j1 = (uint)(4 - m_base / 9) % 4;
            int ptr = m_base;

            for (int j = 0; j < 6; j++)
            {
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 4 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 1 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 5 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 2 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 6 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 18 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 4 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 19 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 5 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 20 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 4 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 1 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 5 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 2 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 6 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 18 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 4 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 19 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 5 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 20 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 4 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 1 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 5 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 2 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 6 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 18 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 4 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 19 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 5 + 36) % 36];
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 20 + 36) % 36] ^= m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (3 * ((j1 + j) % 4) + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
            };

            ptr = ptr - 18;

            for (int j = 0; j < 13; j++)
            {
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 12 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 24 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 12 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 13 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 24 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 12 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 13 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 25 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 11 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
            }

            m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
            m_state[(ptr + 12 + 36) % 36] ^= m_state[(ptr + 36) % 36];
            m_state[(ptr + 24 + 36) % 36] ^= m_state[(ptr + 36) % 36];

            uint[] result = new uint[HashSize / 4];

            for (int j = 0; j < 4; j++)
            {
                result[j] = m_state[(ptr + 1 + j + 36) % 36];
                result[4 + j] = m_state[(ptr + 12 + j + 36) % 36];
                result[8 + j] = m_state[(ptr + 24 + j + 36) % 36];
            }

            return Converters.ConvertUIntsToBytes(result);
        }

        protected override void TransformBlocks(byte[] a_data, int a_index, int a_length)
        {
            uint[] data = Converters.ConvertBytesToUInts(a_data, a_index, (a_length / 4) * 4);

            uint row0, row1, row2, row3;
            uint col0, col1, col2, col3;
            uint tmp;
            int ptr = m_base;
            uint j1 = (uint)(4 - m_base / 9) % 4;
            int j = 0;

            uint[] state = new uint[36];
            Array.Copy(m_state, state, 36);

            if ((j1 != 0) && (a_length >= 4))
            {
                if (j1 <= 1)
                {
                    state[(-9 * 1 + 16 + 36) % 36] ^= state[(-9 * 1 + 36) % 36];
                    state[(-9 * 1 + 36) % 36] = data[j];
                    state[(-9 * 1 + 8 + 36) % 36] ^= state[(-9 * 1 + 36) % 36];
                    state[(-9 * 1 + 1 + 36) % 36] ^= state[(-9 * 1 + 27 + 36) % 36];
                    state[(-9 * 1 + 4 + 36) % 36] ^= state[(-9 * 1 + 30 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 6 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 1 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 1 + 2)) + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 6 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 1 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 1 + 3)) + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 6 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 1 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;
                    a_length -= 4;
                    ptr -= 9;
                }

                if ((j1 <= 2) && (a_length >= 4))
                {
                    state[(-9 * 2 + 16 + 36) % 36] ^= state[(-9 * 2 + 36) % 36];
                    state[(-9 * 2 + 36) % 36] = data[j];
                    state[(-9 * 2 + 8 + 36) % 36] ^= state[(-9 * 2 + 36) % 36];
                    state[(-9 * 2 + 1 + 36) % 36] ^= state[(-9 * 2 + 27 + 36) % 36];
                    state[(-9 * 2 + 4 + 36) % 36] ^= state[(-9 * 2 + 30 + 36) % 36];
                    state[((-3 * (3 * 2 + 1)) + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 4 + 36) % 36];

                    state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 6 + 36) % 36];
                    state[((-3 * (3 * 2 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 2 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 2 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 2 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 2 + 2)) + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 6 + 36) % 36];
                    state[((-3 * (3 * 2 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 2 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 2 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 2 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 2 + 3)) + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 6 + 36) % 36];
                    state[((-3 * (3 * 2 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 2 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 2 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 2 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;
                    a_length -= 4;
                    ptr -= 9;
                }

                if ((j1 <= 3) && (a_length >= 4))
                {
                    state[(-9 * 3 + 16 + 36) % 36] ^= state[(-9 * 3 + 36) % 36];
                    state[(-9 * 3 + 36) % 36] = data[j];
                    state[(-9 * 3 + 8 + 36) % 36] ^= state[(-9 * 3 + 36) % 36];
                    state[(-9 * 3 + 1 + 36) % 36] ^= state[(-9 * 3 + 27 + 36) % 36];
                    state[(-9 * 3 + 4 + 36) % 36] ^= state[(-9 * 3 + 30 + 36) % 36];
                    state[((-3 * (3 * 3 + 1)) + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 6 + 36) % 36];
                    state[((-3 * (3 * 3 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 3 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 3 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 3 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 3 + 2)) + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 6 + 36) % 36];
                    state[((-3 * (3 * 3 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 3 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 3 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 3 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 3 + 3)) + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 6 + 36) % 36];
                    state[((-3 * (3 * 3 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 3 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 3 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 3 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;
                    a_length -= 4;
                    ptr -= 9;
                }
            }

            int len_mod = (a_length / 4) % 4;
            int len_div = a_length / 16;

            for (int j2 = 0; j2 < len_div; j2++)
            {
                state[(-9 * 0 + 16 + 36) % 36] ^= state[(-9 * 0 + 36) % 36];
                state[(-9 * 0 + 36) % 36] = data[j];
                state[(-9 * 0 + 8 + 36) % 36] ^= state[(-9 * 0 + 36) % 36];
                state[(-9 * 0 + 1 + 36) % 36] ^= state[(-9 * 0 + 27 + 36) % 36];
                state[(-9 * 0 + 4 + 36) % 36] ^= state[(-9 * 0 + 30 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 6 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 0 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 0 + 2)) + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 6 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 0 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 0 + 3)) + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 6 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 0 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;

                state[(-9 * 1 + 16 + 36) % 36] ^= state[(-9 * 1 + 36) % 36];
                state[(-9 * 1 + 36) % 36] = data[j];
                state[(-9 * 1 + 8 + 36) % 36] ^= state[(-9 * 1 + 36) % 36];
                state[(-9 * 1 + 1 + 36) % 36] ^= state[(-9 * 1 + 27 + 36) % 36];
                state[(-9 * 1 + 4 + 36) % 36] ^= state[(-9 * 1 + 30 + 36) % 36];
                state[((-3 * (3 * 1 + 1)) + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 6 + 36) % 36];
                state[((-3 * (3 * 1 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 1 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 1 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 1 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 1 + 2)) + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 6 + 36) % 36];
                state[((-3 * (3 * 1 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 1 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 1 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 1 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 1 + 3)) + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 6 + 36) % 36];
                state[((-3 * (3 * 1 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 1 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 1 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 1 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;

                state[(-9 * 2 + 16 + 36) % 36] ^= state[(-9 * 2 + 36) % 36];
                state[(-9 * 2 + 36) % 36] = data[j];
                state[(-9 * 2 + 8 + 36) % 36] ^= state[(-9 * 2 + 36) % 36];
                state[(-9 * 2 + 1 + 36) % 36] ^= state[(-9 * 2 + 27 + 36) % 36];
                state[(-9 * 2 + 4 + 36) % 36] ^= state[(-9 * 2 + 30 + 36) % 36];
                state[((-3 * (3 * 2 + 1)) + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 6 + 36) % 36];
                state[((-3 * (3 * 2 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 2 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 2 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 2 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 2 + 2)) + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 6 + 36) % 36];
                state[((-3 * (3 * 2 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 2 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 2 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 2 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 2 + 3)) + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 6 + 36) % 36];
                state[((-3 * (3 * 2 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 2 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 2 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 2 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;

                state[(-9 * 3 + 16 + 36) % 36] ^= state[(-9 * 3 + 36) % 36];
                state[(-9 * 3 + 36) % 36] = data[j];
                state[(-9 * 3 + 8 + 36) % 36] ^= state[(-9 * 3 + 36) % 36];
                state[(-9 * 3 + 1 + 36) % 36] ^= state[(-9 * 3 + 27 + 36) % 36];
                state[(-9 * 3 + 4 + 36) % 36] ^= state[(-9 * 3 + 30 + 36) % 36];
                state[((-3 * (3 * 3 + 1)) + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 6 + 36) % 36];
                state[((-3 * (3 * 3 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 3 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 3 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 3 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 3 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 3 + 2)) + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 6 + 36) % 36];
                state[((-3 * (3 * 3 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 3 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 3 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 3 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 3 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 3 + 3)) + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 6 + 36) % 36];
                state[((-3 * (3 * 3 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 3 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 3 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 3 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 3 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 3 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;
            }

            if (len_mod >= 1)
            {
                state[(-9 * 0 + 16 + 36) % 36] ^= state[(-9 * 0 + 36) % 36];
                state[(-9 * 0 + 36) % 36] = data[j];
                state[(-9 * 0 + 8 + 36) % 36] ^= state[(-9 * 0 + 36) % 36];
                state[(-9 * 0 + 1 + 36) % 36] ^= state[(-9 * 0 + 27 + 36) % 36];
                state[(-9 * 0 + 4 + 36) % 36] ^= state[(-9 * 0 + 30 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 6 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 0 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 0 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 0 + 2)) + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 6 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 0 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 0 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (3 * 0 + 3)) + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 6 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (3 * 0 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 0 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (3 * 0 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (3 * 0 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                j++;

                if (len_mod >= 2)
                {
                    state[(-9 * 1 + 16 + 36) % 36] ^= state[(-9 * 1 + 36) % 36];
                    state[(-9 * 1 + 36) % 36] = data[j];
                    state[(-9 * 1 + 8 + 36) % 36] ^= state[(-9 * 1 + 36) % 36];
                    state[(-9 * 1 + 1 + 36) % 36] ^= state[(-9 * 1 + 27 + 36) % 36];
                    state[(-9 * 1 + 4 + 36) % 36] ^= state[(-9 * 1 + 30 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 6 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 1 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 1 + 2)) + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 6 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 1 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (3 * 1 + 3)) + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 6 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (3 * 1 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 1 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (3 * 1 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (3 * 1 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;

                    if (len_mod >= 3)
                    {
                        state[(-9 * 2 + 16 + 36) % 36] ^= state[(-9 * 2 + 36) % 36];
                        state[(-9 * 2 + 36) % 36] = data[j];
                        state[(-9 * 2 + 8 + 36) % 36] ^= state[(-9 * 2 + 36) % 36];
                        state[(-9 * 2 + 1 + 36) % 36] ^= state[(-9 * 2 + 27 + 36) % 36];
                        state[(-9 * 2 + 4 + 36) % 36] ^= state[(-9 * 2 + 30 + 36) % 36];
                        state[((-3 * (3 * 2 + 1)) + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 4 + 36) % 36];
                        state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 5 + 36) % 36];
                        state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 6 + 36) % 36];
                        state[((-3 * (3 * 2 + 1)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 4 + 36) % 36];
                        state[((-3 * (3 * 2 + 1)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 5 + 36) % 36];
                        state[((-3 * (3 * 2 + 1)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 1)) + 6 + 36) % 36];
                        col0 = col1 = col2 = col3 = 0;
                        row0 = row1 = row2 = row3 = 0;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36])];
                        col0 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 8)];
                        row1 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 16)];
                        row2 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 36) % 36] >> 24)];
                        row3 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36])];
                        row0 = tmp;
                        col1 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 8)];
                        col1 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] >> 24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36])];
                        row0 ^= tmp;
                        col2 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 16)];
                        col2 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] >> 24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36])];
                        row0 ^= tmp;
                        col3 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 8)];
                        row1 ^= tmp;
                        col3 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 16)];
                        row2 ^= tmp;
                        col3 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] >> 24)];
                        col3 ^= tmp;
                        state[((-3 * (3 * 2 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                        state[((-3 * (3 * 2 + 2)) + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 4 + 36) % 36];
                        state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 5 + 36) % 36];
                        state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 6 + 36) % 36];
                        state[((-3 * (3 * 2 + 2)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 4 + 36) % 36];
                        state[((-3 * (3 * 2 + 2)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 5 + 36) % 36];
                        state[((-3 * (3 * 2 + 2)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 2)) + 6 + 36) % 36];
                        col0 = col1 = col2 = col3 = 0;
                        row0 = row1 = row2 = row3 = 0;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36])];
                        col0 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 8)];
                        row1 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 16)];
                        row2 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 36) % 36] >> 24)];
                        row3 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36])];
                        row0 = tmp;
                        col1 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 8)];
                        col1 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] >> 24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36])];
                        row0 ^= tmp;
                        col2 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 16)];
                        col2 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] >> 24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36])];
                        row0 ^= tmp;
                        col3 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 8)];
                        row1 ^= tmp;
                        col3 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 16)];
                        row2 ^= tmp;
                        col3 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] >> 24)];
                        col3 ^= tmp;
                        state[((-3 * (3 * 2 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                        state[((-3 * (3 * 2 + 3)) + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 4 + 36) % 36];
                        state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 5 + 36) % 36];
                        state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 6 + 36) % 36];
                        state[((-3 * (3 * 2 + 3)) + 18 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 4 + 36) % 36];
                        state[((-3 * (3 * 2 + 3)) + 19 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 5 + 36) % 36];
                        state[((-3 * (3 * 2 + 3)) + 20 + 36) % 36] ^= state[((-3 * (3 * 2 + 3)) + 6 + 36) % 36];
                        col0 = col1 = col2 = col3 = 0;
                        row0 = row1 = row2 = row3 = 0;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36])];
                        col0 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 8)];
                        row1 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 16)];
                        row2 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 36) % 36] >> 24)];
                        row3 = tmp;
                        col0 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36])];
                        row0 = tmp;
                        col1 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 8)];
                        col1 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 16)];
                        row2 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] >> 24)];
                        row3 ^= tmp;
                        col1 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36])];
                        row0 ^= tmp;
                        col2 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 8)];
                        row1 ^= tmp;
                        col2 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 16)];
                        col2 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] >> 24)];
                        row3 ^= tmp;
                        col2 ^= tmp;
                        tmp = s_aes_style_table0[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36])];
                        row0 ^= tmp;
                        col3 = tmp;
                        tmp = s_aes_style_table1[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 8)];
                        row1 ^= tmp;
                        col3 ^= tmp;
                        tmp = s_aes_style_table2[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 16)];
                        row2 ^= tmp;
                        col3 ^= tmp;
                        tmp = s_aes_style_table3[(byte)(state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] >> 24)];
                        col3 ^= tmp;
                        state[((-3 * (3 * 2 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                        row0 = ((row0 << 24) | (row0 >> 8));
                        row1 = ((row1 << 24) | (row1 >> 8));
                        row2 = ((row2 << 24) | (row2 >> 8));
                        row3 = ((row3 << 24) | (row3 >> 8));
                        state[((-3 * (3 * 2 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                        j++;
                    }
                }
            }

            Array.Copy(state, m_state, 36);

            m_base = (ptr - 9 * len_mod + 2 * 36) % 36;
        }

        public Fugue384()
            : base(NBitcoin.Altcoins.HashX11.HashSize.HashSize384, 36)
        {
        }

        public override void Initialize()
        {
            base.Initialize();

            Array.Copy(s_IV384, 0, m_state, BlockSize - s_IV384.Length, s_IV384.Length);
        }
    };

    internal class Fugue512 : Fugue512Base
    {
        #region Consts
        private readonly static uint[] s_IV512 = 
            {
                0x7EA50788, 0x75AF16E6, 0xDBE4D3C5, 0x27B09AAC, 
                0x17F115D9, 0x54CCEEB6, 0x0B02E806, 0xD1EF924A, 
                0xC9E2C6AA, 0x9813B2DD, 0x3858E6CA, 0x3F207F43, 
                0xE778EA25, 0xD6DD1F95, 0x1DD16EDA, 0x67353EE1
            };
        #endregion

        protected override byte[] GetResult()
        {
            uint row0, row1, row2, row3;
            uint col0, col1, col2, col3;
            uint tmp;
            uint j1 = (uint)(3 - m_base / 12) % 3;
            int ptr = m_base;

            for (int j = 0; j < 8; j++)
            {
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 1 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 2 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 6 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 18 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 19 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 20 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 1 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 2 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 6 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 18 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 19 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 20 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 1 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 2 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 6 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 18 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 19 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 20 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 1 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 2 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 6 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 18 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 4 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 19 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 5 + 36) % 36];
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 20 + 36) % 36] ^= m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[((-3 * (4 * ((j1 + j) % 3) + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
            }

            ptr = ptr - 24;

            for (int j = 0; j < 13; j++)
            {
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 9 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 18 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 27 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 9 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 10 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 18 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 27 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 9 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 10 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 19 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 27 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 9 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 10 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 19 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                m_state[(ptr + 28 + 36) % 36] ^= m_state[(ptr + 36) % 36];
                ptr = ((ptr - 8 + 36) % 36);
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(m_state[(ptr + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(m_state[(ptr + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(m_state[(ptr + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(m_state[(ptr + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                m_state[(ptr + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                m_state[(ptr + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
            }

            m_state[(ptr + 4 + 36) % 36] ^= m_state[(ptr + 36) % 36];
            m_state[(ptr + 9 + 36) % 36] ^= m_state[(ptr + 36) % 36];
            m_state[(ptr + 18 + 36) % 36] ^= m_state[(ptr + 36) % 36];
            m_state[(ptr + 27 + 36) % 36] ^= m_state[(ptr + 36) % 36];

            uint[] result = new uint[HashSize / 4];

            for (int j = 0; j < 4; j++)
            {
                result[j] = m_state[(ptr + 1 + j + 36) % 36];
                result[4 + j] = m_state[(ptr + 9 + j + 36) % 36];
                result[8 + j] = m_state[(ptr + 18 + j + 36) % 36];
                result[12 + j] = m_state[(ptr + 27 + j + 36) % 36];
            }

            return Converters.ConvertUIntsToBytes(result);
        }

        protected override void TransformBlocks(byte[] a_data, int a_index, int a_length)
        {
            uint[] data = Converters.ConvertBytesToUInts(a_data, a_index, (a_length / 4) * 4);

            uint row0, row1, row2, row3;
            uint col0, col1, col2, col3;
            uint tmp;
            int ptr = m_base;
            uint j1 = (uint)(3 - m_base / 12) % 3;
            int j = 0;

            uint[] state = new uint[36];
            Array.Copy(m_state, state, 36);

            if ((j1 != 0) && (a_length >= 4))
            {
                if (j1 <= 1)
                {
                    state[(-12 * 1 + 22 + 36) % 36] ^= state[(-12 * 1 + 36) % 36];
                    state[(-12 * 1 + 36) % 36] = data[j];
                    state[(-12 * 1 + 8 + 36) % 36] ^= state[(-12 * 1 + 36) % 36];
                    state[(-12 * 1 + 1 + 36) % 36] ^= state[(-12 * 1 + 24 + 36) % 36];
                    state[(-12 * 1 + 4 + 36) % 36] ^= state[(-12 * 1 + 27 + 36) % 36];
                    state[(-12 * 1 + 7 + 36) % 36] ^= state[(-12 * 1 + 30 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 1 + 2)) + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 1 + 3)) + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 1 + 4)) + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;
                    a_length -= 4;
                    ptr -= 12;
                }

                if ((j1 <= 2) && (a_length >= 4))
                {
                    state[(-12 * 2 + 22 + 36) % 36] ^= state[(-12 * 2 + 36) % 36];
                    state[(-12 * 2 + 36) % 36] = data[j];
                    state[(-12 * 2 + 8 + 36) % 36] ^= state[(-12 * 2 + 36) % 36];
                    state[(-12 * 2 + 1 + 36) % 36] ^= state[(-12 * 2 + 24 + 36) % 36];
                    state[(-12 * 2 + 4 + 36) % 36] ^= state[(-12 * 2 + 27 + 36) % 36];
                    state[(-12 * 2 + 7 + 36) % 36] ^= state[(-12 * 2 + 30 + 36) % 36];
                    state[((-3 * (4 * 2 + 1)) + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 6 + 36) % 36];
                    state[((-3 * (4 * 2 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 2 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 2 + 2)) + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 6 + 36) % 36];
                    state[((-3 * (4 * 2 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 2 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 2 + 3)) + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 6 + 36) % 36];
                    state[((-3 * (4 * 2 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 2 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 2 + 4)) + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 6 + 36) % 36];
                    state[((-3 * (4 * 2 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 4 + 36) % 36];
                    state[((-3 * (4 * 2 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 5 + 36) % 36];
                    state[((-3 * (4 * 2 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 2 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;
                    a_length -= 4;
                    ptr -= 12;
                }
            }

            int len_mod = (a_length / 4) % 3;
            int len_div = a_length / 12;

            for (int j2 = 0; j2 < len_div; j2++)
            {
                state[(-12 * 0 + 22 + 36) % 36] ^= state[(-12 * 0 + 36) % 36];
                state[(-12 * 0 + 36) % 36] = data[j];
                state[(-12 * 0 + 8 + 36) % 36] ^= state[(-12 * 0 + 36) % 36];
                state[(-12 * 0 + 1 + 36) % 36] ^= state[(-12 * 0 + 24 + 36) % 36];
                state[(-12 * 0 + 4 + 36) % 36] ^= state[(-12 * 0 + 27 + 36) % 36];
                state[(-12 * 0 + 7 + 36) % 36] ^= state[(-12 * 0 + 30 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 0 + 2)) + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp; tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp; tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp; tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp; tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp; tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp; tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp; tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp; tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));

                state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 0 + 3)) + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 0 + 4)) + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;

                state[(-12 * 1 + 22 + 36) % 36] ^= state[(-12 * 1 + 36) % 36];
                state[(-12 * 1 + 36) % 36] = data[j];
                state[(-12 * 1 + 8 + 36) % 36] ^= state[(-12 * 1 + 36) % 36];
                state[(-12 * 1 + 1 + 36) % 36] ^= state[(-12 * 1 + 24 + 36) % 36];
                state[(-12 * 1 + 4 + 36) % 36] ^= state[(-12 * 1 + 27 + 36) % 36];
                state[(-12 * 1 + 7 + 36) % 36] ^= state[(-12 * 1 + 30 + 36) % 36];
                state[((-3 * (4 * 1 + 1)) + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 6 + 36) % 36];
                state[((-3 * (4 * 1 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 1 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 1 + 2)) + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 6 + 36) % 36];
                state[((-3 * (4 * 1 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 1 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 1 + 3)) + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 6 + 36) % 36];
                state[((-3 * (4 * 1 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 1 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 1 + 4)) + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 6 + 36) % 36];
                state[((-3 * (4 * 1 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 1 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 1 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 1 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;

                state[(-12 * 2 + 22 + 36) % 36] ^= state[(-12 * 2 + 36) % 36];
                state[(-12 * 2 + 36) % 36] = data[j];
                state[(-12 * 2 + 8 + 36) % 36] ^= state[(-12 * 2 + 36) % 36];
                state[(-12 * 2 + 1 + 36) % 36] ^= state[(-12 * 2 + 24 + 36) % 36];
                state[(-12 * 2 + 4 + 36) % 36] ^= state[(-12 * 2 + 27 + 36) % 36];
                state[(-12 * 2 + 7 + 36) % 36] ^= state[(-12 * 2 + 30 + 36) % 36];
                state[((-3 * (4 * 2 + 1)) + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 6 + 36) % 36];
                state[((-3 * (4 * 2 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 2 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 2 + 2)) + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 6 + 36) % 36];
                state[((-3 * (4 * 2 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 2 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 2 + 3)) + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 6 + 36) % 36];
                state[((-3 * (4 * 2 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 2 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 2 + 4)) + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 6 + 36) % 36];
                state[((-3 * (4 * 2 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 2 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 2 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 2 + 4)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 2 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 2 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;
            }

            if (len_mod >= 1)
            {
                state[(-12 * 0 + 22 + 36) % 36] ^= state[(-12 * 0 + 36) % 36];
                state[(-12 * 0 + 36) % 36] = data[j];
                state[(-12 * 0 + 8 + 36) % 36] ^= state[(-12 * 0 + 36) % 36];
                state[(-12 * 0 + 1 + 36) % 36] ^= state[(-12 * 0 + 24 + 36) % 36];
                state[(-12 * 0 + 4 + 36) % 36] ^= state[(-12 * 0 + 27 + 36) % 36];
                state[(-12 * 0 + 7 + 36) % 36] ^= state[(-12 * 0 + 30 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 1)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 0 + 2)) + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 2)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 0 + 3)) + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 3)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                state[((-3 * (4 * 0 + 4)) + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 6 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 4 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 5 + 36) % 36];
                state[((-3 * (4 * 0 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 0 + 4)) + 6 + 36) % 36];
                col0 = col1 = col2 = col3 = 0;
                row0 = row1 = row2 = row3 = 0;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36])];
                col0 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36] >> 8)];
                row1 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36] >> 16)];
                row2 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 36) % 36] >> 24)];
                row3 = tmp;
                col0 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36])];
                row0 = tmp;
                col1 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] >> 8)];
                col1 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col1 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36])];
                row0 ^= tmp;
                col2 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] >> 16)];
                col2 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] >> 24)];
                row3 ^= tmp;
                col2 ^= tmp;
                tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36])];
                row0 ^= tmp;
                col3 = tmp;
                tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] >> 8)];
                row1 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] >> 16)];
                row2 ^= tmp;
                col3 ^= tmp;
                tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] >> 24)];
                col3 ^= tmp;
                state[((-3 * (4 * 0 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                row0 = ((row0 << 24) | (row0 >> 8));
                row1 = ((row1 << 24) | (row1 >> 8));
                row2 = ((row2 << 24) | (row2 >> 8));
                row3 = ((row3 << 24) | (row3 >> 8));
                state[((-3 * (4 * 0 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                j++;

                if (len_mod >= 2)
                {
                    state[(-12 * 1 + 22 + 36) % 36] ^= state[(-12 * 1 + 36) % 36];
                    state[(-12 * 1 + 36) % 36] = data[j];
                    state[(-12 * 1 + 8 + 36) % 36] ^= state[(-12 * 1 + 36) % 36];
                    state[(-12 * 1 + 1 + 36) % 36] ^= state[(-12 * 1 + 24 + 36) % 36];
                    state[(-12 * 1 + 4 + 36) % 36] ^= state[(-12 * 1 + 27 + 36) % 36];
                    state[(-12 * 1 + 7 + 36) % 36] ^= state[(-12 * 1 + 30 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 1)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 1)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 1)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 1)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 1)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 1)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 1 + 2)) + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 2)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 2)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 2)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 2)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 2)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 2)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 1 + 3)) + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 3)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 3)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 3)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 3)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 3)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 3)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);
                    state[((-3 * (4 * 1 + 4)) + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 6 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 18 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 4 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 19 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 5 + 36) % 36];
                    state[((-3 * (4 * 1 + 4)) + 20 + 36) % 36] ^= state[((-3 * (4 * 1 + 4)) + 6 + 36) % 36];
                    col0 = col1 = col2 = col3 = 0;
                    row0 = row1 = row2 = row3 = 0;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36])];
                    col0 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 8)];
                    row1 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 16)];
                    row2 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 36) % 36] >> 24)];
                    row3 = tmp;
                    col0 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36])];
                    row0 = tmp;
                    col1 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 8)];
                    col1 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col1 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36])];
                    row0 ^= tmp;
                    col2 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 16)];
                    col2 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] >> 24)];
                    row3 ^= tmp;
                    col2 ^= tmp;
                    tmp = s_aes_style_table0[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36])];
                    row0 ^= tmp;
                    col3 = tmp;
                    tmp = s_aes_style_table1[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 8)];
                    row1 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table2[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 16)];
                    row2 ^= tmp;
                    col3 ^= tmp;
                    tmp = s_aes_style_table3[(byte)(state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] >> 24)];
                    col3 ^= tmp;
                    state[((-3 * (4 * 1 + 4)) + 36) % 36] = ((row0 ^ col0) & 0x000000ff) ^ ((row1 ^ col1) & 0x0000ff00) ^ ((row2 ^ col2) & 0x00ff0000) ^ ((row3 ^ col3) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 4)) + 1 + 36) % 36] = ((row0 ^ col1) & 0x000000ff) ^ ((row1 ^ col2) & 0x0000ff00) ^ ((row2 ^ col3) & 0x00ff0000) ^ ((row3 ^ col0) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 4)) + 2 + 36) % 36] = ((row0 ^ col2) & 0x000000ff) ^ ((row1 ^ col3) & 0x0000ff00) ^ ((row2 ^ col0) & 0x00ff0000) ^ ((row3 ^ col1) & 0xff000000);
                    row0 = ((row0 << 24) | (row0 >> 8));
                    row1 = ((row1 << 24) | (row1 >> 8));
                    row2 = ((row2 << 24) | (row2 >> 8));
                    row3 = ((row3 << 24) | (row3 >> 8));
                    state[((-3 * (4 * 1 + 4)) + 3 + 36) % 36] = ((row0 ^ col3) & 0x000000ff) ^ ((row1 ^ col0) & 0x0000ff00) ^ ((row2 ^ col1) & 0x00ff0000) ^ ((row3 ^ col2) & 0xff000000);

                    j++;
                }
            }

            Array.Copy(state, m_state, 36);

            m_base = (ptr - 12 * len_mod + 2 * 36) % 36;
        }

        public Fugue512()
            : base(NBitcoin.Altcoins.HashX11.HashSize.HashSize512, 36)
        {
        }

        public override void Initialize()
        {
            base.Initialize();

            Array.Copy(s_IV512, 0, m_state, BlockSize - s_IV512.Length, s_IV512.Length);
        }
    };
}